Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Pedagogic368
Frequent Visitor

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. 

2 ACCEPTED SOLUTIONS
stevedep
Memorable Member
Memorable Member

Like this?

stevedep_0-1616228102085.png

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. 

 

View solution in original post

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. 

View solution in original post

11 REPLIES 11
stevedep
Memorable Member
Memorable Member

Like this?

stevedep_0-1616228102085.png

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. 

 

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, 

 

 

HI Steve.

 

Currently in the Return we have a FILTER on the taskName so that it returns only those Task with the Name that equals (exactly) the word release.  However, the task name(s) actually "contains" the word "release".

 

So it would look something like this (but I cannot get the CONTAIN function to work). Does this help explain it? 

 

RETURN

CALCULATE (MIN('Table'[Finish Date].[Date]), CONTAINS(ALLSELECTED('Table'), [Task Name] "Release"

Thanks -

BTW I have been responding but not all my responses get posted. I really appreciate your help. I am so close!

 

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. 

Thank you so much, this IS GREAT! I could not figure out how to add the CONTAINSSTRING.

 

MUCH APPRECIATED


@Pedagogic368 wrote:

Thank you so much, this IS GREAT! I could not figure out how to add the CONTAINSSTRING.

 

MUCH APPRECIATED


Welcome, glad to be of help.

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
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

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! 😶

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? 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.