Manage hierarchies Parent/child/sub-child

  • Manage hierarchies Parent/child/sub-child

    Posted by DSC Communities on April 2, 2020 at 7:20 am
    • Jonathan Lascaux

      Member

      April 2, 2020 at 7:20 AM

      ?Hi,

      I contact you for the first time in this channel to get your support. I think I miss some general concepts.

      I have a timesheet table with these info :
      – Task ID
      – Record Date
      – Time recorded
      – Parent Task ID

      I can have tasks setup this way (a task can only have one parent)
      – Task 1
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 2
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā – TaskĀ 4
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 3

      My goal is to display in Power BI, my tasks, with the hierarchies and the time spent per task (I could add a filter per date later on, but this should be easy :)):
      – Task 1Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  1 hourĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 2Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  2 hours
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā – TaskĀ 4Ā Ā Ā Ā Ā Ā Ā 1.5 hours
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 3Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  1 hours

      Later on I will want to add a total based on the sub-tasks, but this is later :
      – Task 1Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  1 hourĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  5.5 hours
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 2Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  2 hoursĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  3.5 hours
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā – TaskĀ 4Ā Ā Ā Ā Ā Ā Ā 1.5 hoursĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā  1.5 hours
      Ā Ā Ā Ā Ā Ā Ā Ā  – Task 3Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  1 hoursĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  1 hour

      I was thinking I can create multiple tables with the parent and child IDs for each level of the hierarchy, but after I cannot add the timesheet table …

      Any idea here will be great !

      ——————————
      Jonathan Lascaux

      ——————————

    • Lutz Bendlin

      Member

      April 2, 2020 at 8:42 PM

      Keep everything in one table, with a “ID”Ā  and “Parent ID”Ā  column per row, and then use the PATH() DAX functions to get the desired results.

      ——————————
      Lutz
      ——————————
      ——————————————-

    • Jonathan Lascaux

      Member

      April 3, 2020 at 5:47 AM

      Hi,

      Thank you, this is working great. Just a question, how do you display the hierarchy after using this function ? Don’t we need to split the column per delimiter first and after display each column in a matrix table ? I guess there is another trick, since to do the split, I would need to run this in Power Query.

      Thanks?

      ——————————
      Jonathan Lascaux
      ——————————
      ——————————————-

    • Lutz Bendlin

      Member

      April 6, 2020 at 8:26 AM

      I think you can still do this in DAX, via the PATHITEM() function.Ā  Have you tried that?

      ——————————
      Lutz
      ——————————
      ——————————————-

    DSC Communities replied 6 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Manage hierarchies Parent/child/sub-child’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!