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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tecumseh
Helper II
Helper II

Calculated Column Get Days Between Max Date And Date

Hi,

Using PBID (March, 2024)

I created a measure to get max date from a column - works as expected
I added a calculated column to compare the measure to the order date in each row - but this is returning zero

 

Days From Max Date =
DATEDIFF( Data[Date], [Max Date], DAY )

 

What am I doing wrong?

Thanks,

-w

2 REPLIES 2
tecumseh
Helper II
Helper II

Thanks @amitchandak 

I need a calculated column. My end goal is to have something I can filter for <= 6 (0 - 6) Or the most recent 7 days. Today function seems to be problematic when refreshing in the Service not returning expected results due to time zones etc....

Thanks,

-w

amitchandak
Super User
Super User

@tecumseh , if you are trying to create a column when Max Date is Measure. You can not use a measure or slicer value in a column

 

Create a measure like

 

Averagex(data,DATEDIFF( Data[Date], [Max Date], DAY ))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.