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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
appelture
Frequent Visitor

DAX formula to return first date based on two other columns

Hi guys,

 

Within DAX I am trying to find the first "Start" date of a project Phase within a project. There are multiple projects within the dataset and each project has multiple tasks assigned to a "Phase". I need to be able to identify the start and finish dates of each phase within the project. 

 

I am using the following formula to find the first date of a Phase, however, this is not limited to Study Name (project), so I get the same start date for each phase across all studies: 

 

TaskStartDate_StudyPhase = CALCULATE ( MIN ( Tasks[TaskStartDate] ), ALLEXCEPT ( Tasks, Tasks[StudyPhase] ) )
 
The image below indicates the state I would like to get to with different start and finish dates for each phase within the Study:

appelture_0-1623716238756.png

 

 

1 ACCEPTED SOLUTION

@appelture 

pls see the attachment below . Hope it's helpful.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@appelture 

please try this

TaskStartDate_StudyPhase = CALCULATE ( MIN ( Tasks[TaskStartDate] ), ALLEXCEPT ( Tasks,Tasks[Study Name], Tasks[StudyPhase] ) )





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Ryan, thank you so much. Sorry, I have tried this and it is not working (can't work out why though, since the logic makes sense)... I still get the same start date for each phase across all Studies. Could an AND function be the trick? I am so new to Power BI that I am not sure!?

@appelture 

pls see the attachment below . Hope it's helpful.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu you little LEGEND! Thank you so much, that really helped!! Dimwit that I am, I had created a measure not a new column. Your file helped me see the error of my ways and all is now well in the world 🙂 Thanks again. Have a great one

@appelture 

you can use the same DAX to create measures. pls see attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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