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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.