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
gauravnarchal
Post Prodigy
Post Prodigy

Measure - If less than condition between dates

Hello

 

I need your help to create a measure as below

 

Condition - If Return Date is less than Ship Date return "error" else "ok"

 

Ship DateReturn Date
27-Feb-2126-Feb-21
1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @gauravnarchal 

Create a measure like this :

Measure = IF(SELECTEDVALUE('Table'[Return Date])<SELECTEDVALUE('Table'[Ship Date]),"error","ok")

The effect is as shown :

Ailsamsft_0-1626681341812.png

Best Regards

Community Support Team _ Ailsa Tao

 

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

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @gauravnarchal 

Create a measure like this :

Measure = IF(SELECTEDVALUE('Table'[Return Date])<SELECTEDVALUE('Table'[Ship Date]),"error","ok")

The effect is as shown :

Ailsamsft_0-1626681341812.png

Best Regards

Community Support Team _ Ailsa Tao

 

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

Hi @gauravnarchal ,

 

Calculated Column

Status = IF(DATEDIFF('Table'[Return Date],'Table'[Ship Date],DAY) > 0,"error","ok")
 
Measure:
M Status = IF(DATEDIFF(MAX('Table'[Return Date]),MAX('Table'[Ship Date]),DAY) > 0,"error","ok")
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


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.