5

This link shows how to create family trees/Hierarchy Chart in powerBI using the Hierarchy Chart Custom Viz by Akvelon. It shows how a node could have a multiple parents. But is there a way to have multiple children for the same parent?

Visual diagram:

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

enter image description here

user2543622
  • 5,760
  • 25
  • 91
  • 159
  • 1
    Can you review my edits and let me know if this works with you for intended outcome? This is a really interesting question but wanted to make sure you supplied enough information so that the community could work towards a solid answer. – sgdata Jun 22 '20 at 16:15
  • why do you have dotted lines coming from `jeffrey knight`? – user2543622 Jun 22 '20 at 16:34
  • That's the primary focus of your question I believed - 1 parent, 2 children? – sgdata Jun 22 '20 at 16:39
  • also you need to adjust dataset, we define a child for a parent and not other way around. For example `papa lee` and `granny lee` should have `3` in `parent id` column etc. Please regenerate the data – user2543622 Jun 22 '20 at 16:43
  • yes, i would like to have 2 children for same parents, so all both lines coming from `sandra knight` and `jeffrey knight` should be solid – user2543622 Jun 22 '20 at 16:44
  • Adjusted per your request – sgdata Jun 22 '20 at 17:17
  • 1
    not sure if you have updated data correctly, i have added the screenshot. Please check your query and make changes if required. – user2543622 Jun 22 '20 at 17:24
  • A directed graph (acyclic or not) is much more general and complex to handle than a simple tree graph. I'm fairly certain that this particular visual cannot handle the many-to-many relationships you're wanting. You'll need something specifically designed to handle that kind of structure. – Alexis Olson Jun 25 '20 at 20:06
  • @AlexisOlson is there any other custom visualization that i can use? – user2543622 Jun 26 '20 at 00:20
  • There are some network visuals but the ones I've seen don't give much control over the shape of the graph (and thus wouldn't look like a hierarchy any more). – Alexis Olson Jun 26 '20 at 01:27

0 Answers0