Power BI & DAX: How to Flatten a Parent Child Hierarchy

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 53

  • @lelandholmquest
    @lelandholmquest 3 ปีที่แล้ว

    Thank you! I had read articles and watched other videos that wasted my time. This was exactly the instructions I needed. Greatly appreciate you sharing this.

  • @belinda1631
    @belinda1631 3 ปีที่แล้ว +3

    Awesome! It would have taken me years to understand this. Thanks

  • @jazzista1967
    @jazzista1967 4 ปีที่แล้ว +4

    Sir. Great content and great explanation on how to create the parent /child path and levels. I have been struggling on this concept for a long time . Thanks for taking the time and explain it in great detail. I work in accounting and I needed to understand how to create levels in my chart of accounts.

    • @jazzista1967
      @jazzista1967 4 ปีที่แล้ว

      Also, how did you get the first column ID (Manager Employee ID) in the excel file? Thanks

  • @djskit5275
    @djskit5275 3 ปีที่แล้ว +5

    Awesome Video. Question: Can you dynamically create the columns, Level 1 ID, Level 2 ID etc. In other words, if a new employee is added underneath Linda in the data set, I want it to dynamically create a column called Level 5 ID. I don't want to constantly have to update this. Any ideas? Do you know if this is even possible?

  • @ashishjuneja6574
    @ashishjuneja6574 3 ปีที่แล้ว

    Just one word for this video "Beautiful"
    Great explanation, superb attention to details !!
    Subscribed :)

  • @waterbubbler44
    @waterbubbler44 ปีที่แล้ว +1

    Excellent guide. I was hoping you can help for my use case. I do not need the parent to appear in the child section. So, Tom (VP) report should not contain Tom. Can you please help how I can get that?

  • @BilalMalik-nn4my
    @BilalMalik-nn4my 2 ปีที่แล้ว

    Thanks for taking the time and explain it in great detail

  • @kishanbhise4733
    @kishanbhise4733 2 ปีที่แล้ว

    Thanks very useful video. Can we show 3-4 level hierarchy if i have millions of records in ,can you please suggest which visual can show hierarchy best for such volume of data

  • @adesojijoshua1758
    @adesojijoshua1758 4 ปีที่แล้ว +2

    Awesome! But wish you could have explained the DAX combination more in details.
    by breaking it down.
    I used the LOOKUPVALUE DAX function and got same result.
    Thanks so much.

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว +1

      Noted! :) I have another video on this topic that you might find useful: th-cam.com/video/Zm1hTSe93sE/w-d-xo.html

    • @adesojijoshua1758
      @adesojijoshua1758 4 ปีที่แล้ว +1

      @@KnowledgeBankPro Yes, just watched the video hours ago. Am just amazed as usual. Thanks so much ❤️😊

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว

      @@adesojijoshua1758 awesomeness, glad it was useful

    • @martinbubenheimer6289
      @martinbubenheimer6289 4 ปีที่แล้ว

      @@KnowledgeBankPro I tried both, the LOOKUPVALUE and the CALCULATE/MAX/FILTER code with 3.4 millions rows and 9 path levels and now I know why you are using this code ;-) Incredible difference in performance!

  • @robertstorm1408
    @robertstorm1408 ปีที่แล้ว

    Very helpful! Thanks for the video.

  • @NotYourAverageJoeRogan
    @NotYourAverageJoeRogan 4 ปีที่แล้ว +1

    Subscribed. Great video.
    1) did you explain when and how to use the has direct reports field? You created it, but didn't use it subsequently that I saw.
    2) I followed along closely and implemented this in my dashboard, you might suggest people watch the video to the end before starting to add the fields and formulas, since you can do everything all at once instead of having separate fields as you say.
    This was the perfect video that I needed today. Thank you!

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว

      ty sir, i did a more extensive video on this and actually use Direct reports to mask salaries, you may want to check it out here: th-cam.com/video/Zm1hTSe93sE/w-d-xo.html

  • @martinbubenheimer6289
    @martinbubenheimer6289 4 ปีที่แล้ว +3

    Thank you very much for pointing me to the hierachy filter custom visual! Is there another visual or trick that does the same thing to the pivot table aka Matrix visual, i.e. prevent showing repeated names on subsequent levels of the hierarchy drilldown?

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว

      I have seen one that's in private preview, so i can't mention the company yet, when it comes out it will be the first one that works properly

  • @mohammed333suliman
    @mohammed333suliman 4 ปีที่แล้ว +1

    This is what I am looking for.
    Appreciate it

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว

      Glad it was helpful.... there is a follow up on that video here that you might find to be interesting: th-cam.com/video/Zm1hTSe93sE/w-d-xo.html

  • @ujjwal748
    @ujjwal748 2 ปีที่แล้ว

    Can you please make a video on calculating indirect reports (subordinates)?

  • @wasago
    @wasago 2 ปีที่แล้ว

    Great work! Thank you very much.

  • @blaatfanaat
    @blaatfanaat ปีที่แล้ว

    Thanks, great video. Do you have tips for my use case? I have a similar HR dataset. With row level security I want people to only see "their" part of the hierarchy. The problem is that I have columns for every level (6), but depending on who logs in, there are more or less levels. I.e. the CEO has all the levels, the worker in the lowest part of the hierarchy has only his own level. Showing all levels in a hierachy slicer or in a visual becomes messy. I only want to show the levels equal or lower of the person that logs in. If possible even with a maximum amount of levels.

  • @MyGogla
    @MyGogla 2 ปีที่แล้ว

    Wow this is a gold mine, spasibo!!!

  • @davidlopez-fe2lb
    @davidlopez-fe2lb 2 ปีที่แล้ว

    Any way to control for skip levels? At min 17 of the video there's the column [Level 3] and it has Directors, Developers, and Sales Rep. Any way to make [Level 3] only return Directors else blank?

  • @chandanamb9061
    @chandanamb9061 9 หลายเดือนก่อน

    Is it optimal to add multiple columns to segregate the levels and will it work for auto refresh/incremental refreshed data

  • @gcloud007
    @gcloud007 4 ปีที่แล้ว +1

    This is great and very well explained. Is it possible to download the dataset? Thanks very much.

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว +1

      that dataset i don't think i can, but here is a video that goes into parent child as well and it does come with the dataset th-cam.com/video/Zm1hTSe93sE/w-d-xo.html&feature=emb_logo

    • @gcloud007
      @gcloud007 4 ปีที่แล้ว

      @@KnowledgeBankPro Thanks again, great material!

  • @chandanamb9061
    @chandanamb9061 9 หลายเดือนก่อน

    Hi how do I make it drop down list... Like we will have select all drop down and when we click on it the hierarchy should be visible.. Because this way the size should be fixed and even if there is only 1 item the size will be same or can we make it responsive

  • @workstuff5253
    @workstuff5253 3 ปีที่แล้ว +1

    Thanks for the explanation and clear video.
    Did you know you can swap the EARLIER function with a VAR before the CALCULATE ?

  • @Aadhyagowdabc
    @Aadhyagowdabc 3 ปีที่แล้ว

    Thanks a ton for your help!!!.. Appreciated.

  • @Aadhyagowdabc
    @Aadhyagowdabc ปีที่แล้ว

    problem is when I select a manager it shows his or her count also..how to avoid this. it should just his or her team count. ..any workaround for this?

  • @Pardesigirl789
    @Pardesigirl789 3 ปีที่แล้ว +1

    Hello, I followed all your instructions above. I have the hierarchy done with me power BI but it is not filtering the expenses for me based on hierarchy. Please advice how to fix this?

    • @KnowledgeBankPro
      @KnowledgeBankPro  3 ปีที่แล้ว

      sounds like you might have a problem with how the relationships might be set up, but it's hard to say without seeing the data

  • @madhun9600
    @madhun9600 4 ปีที่แล้ว +2

    Hi - First of all, thank you so much for this video and your explanation and demo is clear cut to understand it completely. Appreciate all your efforts on this.
    I have an additional question on this. This is manipulated on a data view so it can't be merged or joined with any other tables in Edit query (Power query) view. Can this hierarchy be flattened in power query by any chance or any other ways to view it in power query view ?

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว +1

      unfortunately, in order you flatten the parent child hierarchy, you need to have the entire table in your view which is not easy to do in Power Query as it works basically one row at a time. here is another video on Parent/child hierarchies that might shed more light on what you are trying to do: th-cam.com/video/Zm1hTSe93sE/w-d-xo.html

  • @PedroCabraldaCamara
    @PedroCabraldaCamara 4 ปีที่แล้ว +1

    Very good video. Watched it and did it with my data.....but my matrix visual (accounts and values) shows lotta blank rows. If i disable blank in a specific column, it's ok. More than one, i won't get all values. Did it happen to any of you guys?

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว +1

      you can create a new column that would be a product of all other columns and then use that column to filter out rows that have all blanks

    • @PedroCabraldaCamara
      @PedroCabraldaCamara 4 ปีที่แล้ว +2

      @@KnowledgeBankPro it won't work, but it will if you rewrite your measures with ISINSCOPE. Thanks for the video!

    • @KnowledgeBankPro
      @KnowledgeBankPro  4 ปีที่แล้ว

      @@PedroCabraldaCamara no problem

  • @JonathanCHANAL
    @JonathanCHANAL 4 ปีที่แล้ว +1

    Thank you very much, this is perfect!

  • @masgitz
    @masgitz 3 ปีที่แล้ว

    Great video. Thank you

  • @prathameshmane333
    @prathameshmane333 2 ปีที่แล้ว

    What about DirectQuery tables, we cannot apply Path function on DirectQuery tables?

  • @ОлегІльчишин
    @ОлегІльчишин 8 หลายเดือนก่อน

    what to do with the error that all parent values ​​must be in id values.
    and the first id cannot have it because it has no parent.
    For me the Path function doesn't work otherwise, for you it surprisingly works ((
    The value '' in 'tab'[parent_id] must also exist in 'tab'[id]. Please add the missing data and try again.

  • @priya0599
    @priya0599 3 ปีที่แล้ว

    These functions dont work in Direct Query Mode. Any other way to achieve in Direct Mode?

  • @aajmj
    @aajmj ปีที่แล้ว

    Great video

  • @godhapallavi4860
    @godhapallavi4860 3 ปีที่แล้ว

    Hi, Can someone please explain me hasdirectreport column, how we get true and false

    • @KnowledgeBankPro
      @KnowledgeBankPro  3 ปีที่แล้ว

      CONTAINS function looks at the entire Employee table by using All() and then tries to find any records where the current employee ID is the same as the Manager Employee ID, if it finds at least one, it will return True