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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
amestrian
Frequent Visitor

Using MAX(Date) to filter out latest date is not working

I created a calculated column with the following calculation:

last_day=IF(Table[Date]=max(Table[Date]),1,0) 

and applied a filter to all pages to not use Last_day = 1.

 

I just refreshed the data (and got more days) and the column shows last_day = 1 for 03 Apr 2022, when 04 Apr 2022 is actually the latest date in the sample. 

 

Also, even if the filter is there I can still see the data point for 3 Apr in my timeseries plots... 

 

I've read all posts regarding Max(Date) but I haven't seen this issue before. 

Any thoughts?

Why is this calculation suddenly failing? 

3 REPLIES 3
amitchandak
Super User
Super User

@amestrian , Hope the calculation is like this and there was was a typo in what you shared

last_day=IF(Table[Date]=max(Table[Date]),1,0)

 

Just check if the date has timestamp ,if yes,  then try like

 

last_day=IF(datevalues(Table[Date])= datevalues(max(Table[Date])) ,1,0)

@amitchandak 

Indeed that was a typo. Corrected it in the first post for visibility.

 

The Date variable is in date datatype, not datetime. The format is "03 April 2022".

 

I still tried your solution and no luck, the column still returns a 1 for 03 April 2022 instead of 04.

Hi @amestrian ,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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