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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Not Started, Completed, In Progress based on Dates

Hi,

 

I am trying to give status to my progect activities based on Slicer Date:

 

Zahid_Shaikh_0-1628682654077.png

 

Zahid_Shaikh_1-1628683690170.png

 




Measure =
VAR slicer = [SELECTED VALUE]
return
IF('Activities'[PlannedStart] < slicer,"Not Started", IF(slicer > 'Activities'[PlannedFinish], "Completed" , "In Progress"))

But the IF Condition is not taking the Start and Finish Date, it is giving error
 
 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

The Max()/Min() functions express different meanings in calculated and measure, for example:

1. Using the Max() function in calculated is to take the maximum value of this column, see the result below

max_measure = MAX('Activity'[planned finish])

[planned finish] The largest date in the column is 2024.10.9

vyangliumsft_0-1628841220067.png

2. Use the max() function in measure to take the value of the current row.

max_measure = MAX('Activity'[planned finish])

Take out the current value of each row

vyangliumsft_1-1628841220070.png

So use the following function according to your rules, you can compare the value in the slicer with each Activity in the table row by row and compare the start and finish dates of each activity

Measure 2 =
var _select =SELECTEDVALUE('Table'[Date])
return
IF(MAX('Activity'[planned start]) <_select,"Not Started", IF(_select > MAX('Activity'[planned finish]), "Completed" , "In Progress"))

vyangliumsft_3-1628841312667.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi  @Anonymous ,

The Max()/Min() functions express different meanings in calculated and measure, for example:

1. Using the Max() function in calculated is to take the maximum value of this column, see the result below

max_measure = MAX('Activity'[planned finish])

[planned finish] The largest date in the column is 2024.10.9

vyangliumsft_0-1628841220067.png

2. Use the max() function in measure to take the value of the current row.

max_measure = MAX('Activity'[planned finish])

Take out the current value of each row

vyangliumsft_1-1628841220070.png

So use the following function according to your rules, you can compare the value in the slicer with each Activity in the table row by row and compare the start and finish dates of each activity

Measure 2 =
var _select =SELECTEDVALUE('Table'[Date])
return
IF(MAX('Activity'[planned start]) <_select,"Not Started", IF(_select > MAX('Activity'[planned finish]), "Completed" , "In Progress"))

vyangliumsft_3-1628841312667.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

This gave me a partial solution. and Thank you for explaining the concept as well

Tahreem24
Super User
Super User

@Anonymous You need to use some aggregated function with that like MAX etc.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
TomMartens
Super User
Super User

Hey @Anonymous ,

 

the challenge you are facing has a name - Events-in-progress.

 

This article

Events-In-Progress | Gerhard Brueckl on BI & Data (gbrueckl.at)

contains all the necessary links to get started and also to create solutions for more advanced scenarios. A good start is the article by Jason Thomas.

 

Hopefully, this provides some more insights.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Greg_Deckler
Community Champion
Community Champion

@Anonymous 

Measure =
VAR slicer = [SELECTED VALUE]
return
IF(MAX('Activities'[PlannedStart]) < slicer,"Not Started", IF(slicer > MAX('Activities'[PlannedFinish]), "Completed" , "In Progress"))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler , I did try the Min and Max but it is not giving correct answer, as we want to go row by row for every activity in the table and compare the start finish date for each, and not pick Max or Min date from the Column

@Anonymous If you have each event in a table visual then the MAX and MIN will give you the value for that event (it is the max or min of 1). If you are doing something different than that, then would need that detail.

 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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