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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors