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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Scottnap
Frequent Visitor

Date Math bug?

Confounded by this issue and hoping someone can help!  I'm having a problem with date math in a Power BI Measure.

I have a measure that calculates the difference (in days) between TODAY() and a Created date in a table column.  The Created Data is stored as Date/Time format, Short Date.

DATEDIFF_bug.png

Clearly 198 days have not elapsed between TODAY() (01/11/2023 at time of posting) and the created date (12/20/2022).  It should be 22 days.  The Measure calculation is this.

DSC_Measure.png

Oddly enough, I created another measure (DaysElapsed) as a sanity check, and used the same values and the caluclation worked fine!

DE_Measure.png

DE_Value.png

I've noticed the issue appears when I'm subtracting a date from last year but works fine when I'm subtracting a date from this year.  Stumped.

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

Try this and see ... 

Days Since Created = ABS( DATEDIFF(TODAY(), SELECTEDVALUE(TableDateMathBug[Created]), DAY))

 

sevenhills_0-1673461576086.png

 

View solution in original post

2 REPLIES 2
Scottnap
Frequent Visitor

Thanks you for the quick response!  That worked!  

sevenhills
Super User
Super User

Try this and see ... 

Days Since Created = ABS( DATEDIFF(TODAY(), SELECTEDVALUE(TableDateMathBug[Created]), DAY))

 

sevenhills_0-1673461576086.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.