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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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.

mwegener
Most Valuable Professional
Most Valuable Professional

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 - Power BI Tutorials


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors