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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
FelixElliott
Frequent Visitor

Dax formula to prevent a measure from being filtered by a slicer

Hi Everyone I am feeling very stupid because I can't figure out the solution ( think my brain is in Dax overload)

 

I have a measure to calculate the total tourist visitors to regional Victoria (I am in Australia)

 

Regional Vic Visitors =
CALCULATE([Total Visitors],
'Region_Dim_Key'[State] = "Victoria",
'Region_Dim_Key'[Region_Key] <> 2017,
'Region_Dim_Key'[Region_Key] <> 2039,
'Region_Dim_Key'[Region_Key] <> 2037
)
 
The Filters are to exclude specific destinations from the calculation. This measure works fine.
 
I need to track the regional total visitors over time and compare the visitors to sub-regions in a line graph to using a slicer for the sub-regions ie. y - axis total regional visitors and secondary y - axis the sub-region visitor number.
 
When I apply the slicer the regional visitor is filtered and I can't figure out how to modify the Dax code to only apply the slicer filter to the sub-region number and not the regional number. 
 
Thanks in advance
 
 
 
3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @FelixElliott ,

 

Based on the description below code can help you:-

Subregion Visitors = 
CALCULATE(
    [Total Visitors],
    'Region_Dim_Key'[State] = "Victoria",
    'Region_Dim_Key'[Region_Key] = SELECTEDVALUE('Region_Dim_Key'[Region_Key]),
    'Region_Dim_Key'[Region_Key] <> 2017,
    'Region_Dim_Key'[Region_Key] <> 2039,
    'Region_Dim_Key'[Region_Key] <> 2037
)

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

some_bih
Super User
Super User

Hi @FelixElliott  check link with example using DAX function ALLEXCEPT. In your example there is no information enought to provide possible solution, like model and relationships.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Anonymous
Not applicable

Hi @FelixElliott ,

I don't know exactly what you need, can you present it in the form of excel or result chart?Thank you.

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.