cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.