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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Max(date) measure not working in filter

HI! 

I cannot wrap my head around the following situation:

I have multiple measures, that require filtering by latest month and edate(latest month). That is why I decided to create one measure "Latest date"= MAX (Datetable[Date]) that would give me the latest date to use in FILTER. 

 

However the strange thing is that, when the measure is written as MAX (Datetable[Date]) then it does not work in the filter. However, what it works if I write max(Datetable[Date]) directly in the filter or (even stranger), if I create another summarize date table and use the Date field from this in the "Latest date" measure.

 

Is there any explanation for this odd behaviour?  Does not seem to be logical.

 

5 REPLIES 5
amitchandak
Super User
Super User

Where are you using the max date after that? That might push context. 

 

var _maxdate = maxx(datetable,datetable[Date]) should work. But how it used in next formula , might have role in the context.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Using Var in the 'Latest date' measure does not work. However var with max(date) or just max(date) in the later measures works fine.

All the later measures are = CALCULATE (Measure, FILTER( Date= EDATE(Latest period,-/+x)) type.

Anonymous
Not applicable

I clarified this as a bug that happened during DimDate table creation.

- Trying to create same Date tables with same relationships allows the measure max(date) to be used in other measures.

- When I deleted the main DimDate table and renamed the DimDate2 table as DimDate then the bug happened again and the measure max (date) stopped filtering other measures.

az38
Community Champion
Community Champion

Hi @Anonymous 

try to use CALCULATE, like CALCULATE(MAX(Datetable[Date]))

It will enable row an filter context

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

I tried that one too. Wrapping the 'Latest date' measure in a CALCULATE still does not make the measure work in filter

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors