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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
SteveG_91
Helper I
Helper I

Force a measure to not by affected by a slicer

I have a matrix visual with two values in it.  I want one of the values to update based on the month slicer that is on the page but the other value should not update.

 

The value that should not update is a measuer, named "Max Bonus Date", which should select the max BONUS_DATE from a table named "Monthly Estimates 2".  That table has BONUS_DATEs going back over two years, one row per month, with the latest date being 8/1/2022.  What I would like is for the measure to always show the maximum BONUS_DATE, currently 8/1/2022, regardless of the month selected by the slicer.  Then next month when September is added it will show 9/1/2022.

 

Right now if I select July 2022 on the slicer the measure will show 7/1/2022.  If I select June 2022 it will show 6/1/2022, etc.   The slicer should only be affecting the other value on the matrix visual, which uses another measure.

 

I believe there must be an easy way to do this but every combination I've tried using various functions, (ALL, ALLSELECTED, ALLNOBLANKROW, REMOVEFILTERS, SELECTEDVALUES, MAX, CALCULATE) seems to work.  I either get an error or the measure continues to be driven by the slicer.

 

Thanks in advance!

 

 
2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

@SteveG_91 

This should give you what you are looking for.

 

Max Bonus Date = 
CALCULATE ( MAX ( 'Monthly Estimates 2'[BONUS_DATE] ), ALL ( 'Monthly Estimates 2' ) )

 

 

View solution in original post

jdbuchanan71
Super User
Super User

Yep, give this a go.

Max Bonus Date = 
CALCULATE ( MAX ( 'Monthly Estimates 2'[BONUS_DATE] ), ALLEXCEPT ( 'Monthly Estimates 2', 'Monthly Estimates 2'[company_code] ) )

View solution in original post

5 REPLIES 5
jdbuchanan71
Super User
Super User

Yep, give this a go.

Max Bonus Date = 
CALCULATE ( MAX ( 'Monthly Estimates 2'[BONUS_DATE] ), ALLEXCEPT ( 'Monthly Estimates 2', 'Monthly Estimates 2'[company_code] ) )

Worked like a charm.  Thank you!

If you're ever in Atlanta let me know and I'll buy you a beer.  Cheers!

jdbuchanan71
Super User
Super User

@SteveG_91 

This should give you what you are looking for.

 

Max Bonus Date = 
CALCULATE ( MAX ( 'Monthly Estimates 2'[BONUS_DATE] ), ALL ( 'Monthly Estimates 2' ) )

 

 

Sorry, I have another question.  There are three possible dates for each month, each one identified by a column on the table named "company_code".  I'm putting these dates in a matrix visual with the Max Bonus Date as the value and company_code as the column.  There are three unique company_codes, A, B, and C and each has it's own, unique date.  It seems the "ALL" command is causing the matrix to show the same value for each date rather than show the different vlaue for each company_code under it's column on the matrix.  Any suggestions?

Thank you @jdbuchanan71 that worked perfectly.  I knew there had to be a way, I just needed the right sequence of commands.

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.