Forum Discussion
DAX Change Filter Context
- 1 year ago
bi_analyst_2024
What I have understood from your provided information is, you're looking to override the slicer filter context so that for the P1 and P2 classification columns, you still show the customer's true classification in that period, even if it doesn't match the classification filter (e.g., Upper or Lower).P2 True Classification = CALCULATE ( MAX ( YourTable[P2 Classification] ), REMOVEFILTERS ( YourTable[P2 Classification] ) )This will get the P2 Classification for that row, but ignore any filters from the slicer that are filtering out the Lower classification.
REMOVEFILTERS() - Ensures the classification column isn't affected by slicers, allowing the "true" classification to be shown.
MAX() - Helps retrieve the relevant value for each row based on the current filter context.
*************************************************************************************************************************************************If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!
Thank you,
Sarita
Linkedin
Hi bi_analyst_2024 ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you Akash_Varuna for the prompt response.
I used a DAX measure that overrides the slicer filter context to return the actual classification, using REMOVEFILTERS, called "Classification_Override" - you can find it in attached .pbix file.
The key trick is to disable interaction between the P2 Classification slicer and your table visual:
- Click the P2 Classification slicer.
- Go to Format → Edit interactions.
- On your table visual, click the “No filter” icon to stop the slicer from filtering the table.
This way:
The slicer won’t hide customers like Customer3.
The measure will still return the true classification, unaffected by slicer filters.
Please find the attached .pbix file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.