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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate Max and Min Dates Selected Ignoring other Slicer

All I want to do is create a measure that will show me the min date in my date slicer, but the other slicers keep causing it to give me different results. 
I have a table called 'ALl Events' which has columns 'event_start_date' and 'location'. I have slicers for each of these columns and want to have a a measure that will show me the max date on the 'event_start_date' slicer regardless of 'location' slicer. Some locations do not have events every day so it will show me a later date than anticipated. Here's an example:

 

var MaxDate=CALCULATE(MaxX('All Events','All Events'[event_start_date]),ALLSELECTED('All Events'[event_start_date]))

RETURN MaxDate

 This is the result I get - but it should be 9/17/2024

TaylorG_0-1726684569091.png

I also tried this code with the same results

var MaxDate=CALCULATE(MaxX('All Events','All Events'[event_start_date]),ALLEXCEPT('All Events','All Events'[event_start_date]))

RETURN MaxDate



1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured out the solution to my own problem - in case anyone else is having the same issue, I think it has something to do with auto-exist: https://www.sqlbi.com/articles/understanding-dax-auto-exist/

To solve it I created a dimension table for location with a one -many relationship with my Events table. I then used the Dimension[location] column as my slicer instead of the one from my Events table. Then the measure using "ALLEXCEPT" worked!

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I figured out the solution to my own problem - in case anyone else is having the same issue, I think it has something to do with auto-exist: https://www.sqlbi.com/articles/understanding-dax-auto-exist/

To solve it I created a dimension table for location with a one -many relationship with my Events table. I then used the Dimension[location] column as my slicer instead of the one from my Events table. Then the measure using "ALLEXCEPT" worked!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.