Forum Discussion

Pedagogic368's avatar
Pedagogic368
Frequent Visitor
5 years ago
Solved

How to use Task Outline Numbers from MS Project to group together task in Power BI

I have a MS Project with Site, Lot#, and Task Name. Each task has a start Finish Date and % complete. The Task Outline Number corresponds by site, Lot# and Task. For example:

SiteLot#Task Name Start Date Finish DateTask Outline Number
Chicago C1Initiate1/1/20211/1/20211.1.1
ChicagoC1Release1/1/20211/1/20211.1.2
ChicagoC1Report1/1/2021(release date + 30 eDays)1.1.3
ChicagoC4Initiate3/1/20213/1/20211.2.1
Chicago C4Release3/1/20213/1/20211.2.2
Chicago C4Report3/1/2021(release date + 30 eDays)1.2.3
IndianaT2Initiate5/1/20215/1/20212.1.1
IndianaT2Release5/1/20215/1/20212.2.1
IndianaT2Report5/1/2021(release date + 30 eDays)2.2.3

 

How would I go about writing a Dax expression that "links" together the Report - Finish Date from the report to the Release - start date, by "Group" ie Task Number. So if I wanted to know if the Report was finished for Chicago Lot C1, I would look at the Task Outline Number (1.1) find the Release date (1.1.2) and then group it with the corresponding Report (1.1.3) to check the finish date?

 

I know it sounds confusing but there has to be a way to form "groups", right? Thanks. 

  • Like this?

    Measure2 = 
    VAR _sel = SELECTEDVALUE('Table'[Task Outline Number])
    VAR _NR = LEFT(_sel,3)
    RETURN
    CALCULATE(MIN('Table'[Finish Date].[Date]), FILTER(ALLSELECTED('Table'), [Task Name ] = "Release" &&  LEFT([Task Outline Number],3) = _NR))
    

    File is attached.

     

    Kind regards, Steve. 

     

  • stevedep's avatar
    stevedep
    5 years ago

    Then this should be it?

    Measure2 = 
    VAR _sel = SELECTEDVALUE('Table'[Task Outline Number])
    VAR _NR = LEFT(_sel,3)
    RETURN
    CALCULATE(MIN('Table'[Finish Date].[Date]), FILTER(ALLSELECTED('Table'), CONTAINSSTRING([Task Name ],"Release")  &&  LEFT([Task Outline Number],3) = _NR))
    

    File is attached.

    Kind regards, Steve. 

11 Replies

  • Pedagogic368's avatar
    Pedagogic368
    Frequent Visitor

    Update on the table information given above. 

    The task ID is unique to each summary and there are Task Outline levels associated with each task (ie Task Outline Level - Parent summary task = Level 3  and child summary task (Initiate) = Level 4  . The report = Level 5)

    Example for Chicago I want to link the Release Report (Level 5) Date to the Initiate Date on Level 4 :

    Chicago. - The Parent Summary Task (Level 3)  Task Outline Number  = 1.1.1

    Chicago - Initiate. Child Summary Task (Level 4) = 1.1.1.2

    Chicago - Report. (Level 5) Task Outline Number 1.1.1.2.4

     

    Would I first form a Group of all the task under 1.1.1.X (write a DAX that says group first four digits). Extract the Finish Date associated with Initiate and then add +30edays to that date to calculate the Finish date the Report should be completed? Thoughts

    • Pedagogic368's avatar
      Pedagogic368
      Frequent Visitor

      So I wrote this out -

       

      I took the Chicago - Report and I wrote a simple Dax expression that pulls out the ParentTaskName (in the example above the ParentTask Name is Chicago-Initiate. I called this Measure1.  (FYI - The ParentTaskName is a column that exist on the table). Simple!

       
      Measure1 = ('Tasks'[ParentTaskName])
       
      Now I need to extract the ParentTaskName for Measure1.
       
      I  would have to FIND in the table the TaskName = Measure1 ( in this example Chicago-Initiate) and then return the ParentTaskName for Chicago-Initiate (in this example it would be Chicago).
       
      Can anyone help me get to this next step? How would I first find the column with Chicago-Initiate AND THEN return the ParentTaskName of that task?
       
      Any ideas please? 
    • Pedagogic368's avatar
      Pedagogic368
      Frequent Visitor

      So far no help. So let me ask one more time for some advice. ğŸ˜”

      Here is where I am at. 

      Each "grouping" has a similar TaskOutline number. So as I mentioned previously - 

      Group A

      Chicago is 1.1.1

      Chicago- Initiation is 1.1.1.2

      Chicago-Report is 1.1.1.4.2 

      I truncated all to a value of 1.1.1 

       

      Group B

      Indiana is 2.1.1

      Indiana - Initiation is 2.1.1.2

      Indiana -Report is 2.1.1.4.2 

      I truncated all to a value of 2.1.1 

       

      So, as you can see I have several differnt "groups" what I need to do is write a DAX expression that search within each group the Finish Date for the XXXXX-Initiate in each group and then the Start Date for the XXXXX-Report in the same group. HOW DO I DO THIS? THANKS in advance for your help. Please! ğŸ˜¶

  • stevedep's avatar
    stevedep
    Memorable Member

    Like this?

    Measure2 = 
    VAR _sel = SELECTEDVALUE('Table'[Task Outline Number])
    VAR _NR = LEFT(_sel,3)
    RETURN
    CALCULATE(MIN('Table'[Finish Date].[Date]), FILTER(ALLSELECTED('Table'), [Task Name ] = "Release" &&  LEFT([Task Outline Number],3) = _NR))
    

    File is attached.

     

    Kind regards, Steve. 

     

    • Pedagogic368's avatar
      Pedagogic368
      Frequent Visitor

      Hi Steve, thank you very much for your reply and your attached file. I have a few questions (almost there!). Here is your example with my data.

      Measure3 =
      Var _sel = SELECTEDVALUE('Tasks'[TaskOutlineNumber])
      Var _NR = LEFT(_sel,3)//  Creating a "grouping" based off of the first three digits of the TaskOutlineNumber - correct?
      RETURN
      CALCULATE(MIN('Tasks'[TaskFinishDate].[Day]), FILTER(ALLSELECTED('Tasks'),[TaskName]="TO Release" && LEFT([TaskOutlineNumber],3) = _NR))//What is the FILTER doing here? Looking for any task with a Task Name that contains "TO Release" and is within the grouping? If I understood it better I might be able to make this work. Thanks so much! 
    • Pedagogic368's avatar
      Pedagogic368
      Frequent Visitor

      Steve. thanks so much for this helpful information. Can you kindly tell me how I would change the filter portion the code so that it does not have to = "release" but contains in the TASKNAME field the word release.

       

      Right now it has to = (equal) "release" 

       

      Thanks so much, 

       

       

      • stevedep's avatar
        stevedep
        Memorable Member

        Hi,

        Welcome,

        Not sure what you mean?