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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ras_Ile
Advocate I
Advocate I

DAX expression that ignores specific filter/slicer

Dear community,

This seems like an easy-fix, but I am not able to come up with how to deal with this issue.

I have a fact table (let's call it [f_Sales]). 
In this table is a column. Let's call it [SalesCategory]. Let's say that the values in this column are {A, B, C, D, E....}


Now, in my report, I have a slicer on the report page with [SalesCategory]. I need this slicer for some of the KPIs on the report page.

My issue is that I need to create a measure that completely ignores what selections are made on the slicer, but always applies [SalesCategory] = A or B.

I need your support how to write such measure.
I have tried almost everything that I can think of (ALL, ALLEXCEPT, REMOVEFILTERS..) but I am not able to produce a measure that ignores this slicer.

No matter what I try, the slicer is always affecting the measure. (For instance, if I select all categories it will show all categories. If I select categories C-E it will show zero and if I only select category A or B it will show only that category).

I also cannot just use "Edit interactions" on that visual because I need other measures in the same visual to actually comply with the slicer.

Please help!
Rasmus 

1 ACCEPTED SOLUTION
anilkapkoti
Helper II
Helper II

Please Try this measure. 

 

 

SalesCategory=
CALCULATE(
    [YourKPI],
    FILTER(
        ALL('f_Sales'[SalesCategory]), 'f_Sales'[SalesCategory] IN {"A", "B"}
    )
)

 

 

 

 

View solution in original post

1 REPLY 1
anilkapkoti
Helper II
Helper II

Please Try this measure. 

 

 

SalesCategory=
CALCULATE(
    [YourKPI],
    FILTER(
        ALL('f_Sales'[SalesCategory]), 'f_Sales'[SalesCategory] IN {"A", "B"}
    )
)

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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