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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
yashwant101
Helper III
Helper III

DateDiff Issue in Calculated Column

Hi all,

 

I have 2 tables. One is the date universe and the other has multiple date columns for the data. If I put slicer of the date universe and apply datediff for individual columns with max date in date universe. It is calculating incorectly. 

 

Description: I have 2 tables- Calendar & DataDate.

yashwant101_1-1698730278751.png

I have put a date slicer from Calendar table. The Max Date measure is calculated as below:

Max Date = MAX('Calendar'[Date])
It should respond to the slicer. Working as expected.
 
I have created a Date Diff column in DataDate table as below:
Date Diff = DATEDIFF(DataDate[DiffDate].[Date], [Max Date],DAY)
It should give the daysdiff between max date selected in slicer and individual dates. Here is where the issue begins. The Date Diff column is not being affected by the slicer. It us taking difference between individual dates in DataDate table and max date in Calendar table. 
yashwant101_2-1698730668382.png

 

 

Please help me with thus issue. Any help is appreciated.

 

Regards,

Yashwant

1 REPLY 1
Uzi2019
Super User
Super User

Hi @yashwant101 
Please try the below measure:
Measure

DATEDIFF(Min(DataDate[DiffDate]),Max(Calendar[date],day)

Dont create seperate measure for Max of date. you have taken column for calculation when its is numeric calculation try to avoid calculated columns.

 
If my post helps please give kudos and accept it as a solution!
thanks
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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