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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.