Forum Discussion

samdthompson's avatar
samdthompson
Memorable Member
4 years ago
Solved

Dynamic Heirarchy

Hello, was wondering if anyone had made a dynamic heirarchy. 

 

I have a data set of livestock breeding. Each animal will have x number of progeny and so on over generations. I currently have 12 generations and this will continue to grow. The grandparent/parent/child relationship has been flattened successfully and I have a heirarchy that works as expected:

 

 

My problem is when I get another generation, I want it to automatically add itself to the hierarchy rather than having to manually add it in.

 

Currently:

GenA/

   GenB/

      GenC/

         GenD/

            GenE/

               GenF/

                  GenG/

                     GenH/

                        GenI/

                           GenJ/

                              GenK/

                                 GenL

 

When I get new data I need the heirarchy to automatically become:

 

GenA/

   GenB/

      GenC/

         GenD/

            GenE/

               GenF/

                  GenG/

                     GenH/

                        GenI/

                           GenJ/

                              GenK/

                                 GenL/

                                    GenM

 

Cheers,

 

 

7 Replies

    • samdthompson's avatar
      samdthompson
      Memorable Member

      amitchandak  And if I make then rows? Do I need to make some mad bridging table so people can look at everything from GenA downwards or from say GenG downwards?

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi samdthompson 

    How about using matrix?

    Supposing you have a table bellow, then put it into matrix,

    after you add a row into the table, the heirarchy will change,

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

    • samdthompson's avatar
      samdthompson
      Memorable Member

      v-xiaotang, the problem is I want to have the generations automatically added to the matrix as the number grow.

       

      • v-xiaotang's avatar
        v-xiaotang
        Community Support

        Hi samdthompson 

        thanks for your reply.

        In fact, it cannot be automatically added to the matrix unless the data is added to the table of the data source. Powerbi desktop can be used to clean data, calculate data, but cannot create data to datasource.

        In my previous example, if the hierarchy in your data source changes, the hierarchy in the matrix will also change accordingly. So I think modifying the data source is a better way.

         

         

        Best Regards,

        Community Support Team _Tang

        If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi samdthompson 

    Have you solved this problem? If yes, would you mind to accept the answer helpful as the solution or kindly share your solution to improve Power BI.
    Really appreciate!


    Best Regards,
    Community Support Team _Tang