powerbi, как создавать семейные деревья / диаграмму иерархии с несколькими детьми - PullRequest
6 голосов
/ 18 июня 2020

Эта ссылка показывает, как создавать семейные деревья / диаграмму иерархии в powerBI, используя пользовательскую визуализацию диаграммы иерархии от Akvelon . Он показывает, как у узла может быть несколько родителей. Но есть ли способ иметь несколько дочерних элементов для одного и того же родителя?

Визуальная диаграмма:

enter image description here

In case of the above example I would like to show that Jeffrey Knight and Sandra Knight have one more son called my brother.

Reproducible data for problem (Insert in Advanced Editor for Power Query)

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jY5dC4IwFIb/yti1wqbp7DaEoA8IvFxeDDo2oZaMFfjvO5uJ2Y3BYOfdnufdpKScRrSEV2vI3rRX7TDytRAx7un5yViSr3Cs4NbQOpI0wXDsycY+nAYb4IL9wOOl51MvK3Ox6rs/C0o2KDmOJ2XBuGD4hh00jYV+pqReEYNSzJUsxE6R6t46HXDO4gRJnHFtLf6gm/j8c2b6fw0xvnAAWKaLqX+Zr98=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Self ID" = _t, Name = _t, Years = _t, #"Parent ID" = _t, Relationship = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Self ID", Int64.Type}, {"Name", type text}, {"Years", type text}, {"Parent ID", type text}, {"Relationship", type text}})
in
    #"Changed Type"

I am not sure how to have two arrows starting from Jeffrey Knight which is already present in the data. Duplicate rows does not work as powerbi throws an error if two values are identical in the Id column: "items have the same id".

Self Id   Name              Years   Parent Id   Relationship
1         Devin Knight      xxxx-   3&4         self
2         my brother        xxxx-   3&4         brother
3         Sandra Knight     xxxx-               Parent
4         Jeffrey Knight    xxxx-               Parent

###########update 1

if there is any dax coding that could help then please provide the suggestions

##############update 2

this is how the data should look like. Row with self id 3 and 4 indicate a parent with two children. If we enter data this way then the powerbi throws error and I am looking for suggestions

введите описание изображения здесь

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...