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

Using if Clauses

Ms2009_1-1651671899002.png

Hello, 
I wanted to know if somebody knows how to deal with this. I am pretty new to PowerBI Dax, which is why this seemingly simple problem is hard to solve..
So I want to calculate the "delay" column. The calculation should only happen when"Hello" is written into the "Project" column.
The calculation should be Todays Date - Milestone Date. So I want to display the amount of days between the milestone and today's date

Thank you for your help!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a measure like

Delay = 
var currentMilestone = SELECTEDVALUE('Table'[Milestone])
return IF( SELECTEDVALUE('Table'[Project]) = "Hello" && currentMilestone < TODAY(), TODAY() - currentMilestone)

and make sure to set the type of the measure to Whole Number

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Create a measure like

Delay = 
var currentMilestone = SELECTEDVALUE('Table'[Milestone])
return IF( SELECTEDVALUE('Table'[Project]) = "Hello" && currentMilestone < TODAY(), TODAY() - currentMilestone)

and make sure to set the type of the measure to Whole Number

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
Top Kudoed Authors