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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
shuhn1229
Resolver I
Resolver I

Exclude Certain Values From Slicer analysis

Hi all,

 

I am wondering the best way to go about this. I have a table like the below

IDQuantAQuantB
14 
251
331

 

I am trying to setup a slicer that will let users slice out all values less than what is specified based on QuantA column. Meaning If "5" was supplied ID 1 would be filtered out. However, I want the slicer to INCLUDE all values where QuantB has a number, regardless is quantA is under the threshold supplied. What would be the best way to go about this?

 

Thanks

2 REPLIES 2
Alef_Ricardo_
Resolver II
Resolver II

You can achieve this by creating a new calculated column in your data table that will be used to drive the slicer. This column will check the conditions you specified and return a value accordingly. Here's how you can do it:

1. Go to the `Modeling` tab in Power BI and click on `New Column`.
2. Enter the following DAX formula for the new column:

```DAX
IncludeInSlicer =
IF(
[QuantA] >= "5" || NOT(ISBLANK([QuantB])),
"Include",
"Exclude"
)
```

This formula checks if `QuantA` is greater than or equal to 5 or if `QuantB` is not blank, and returns "Include" if true, otherwise it returns "Exclude".

3. Now, create a slicer based on this new `IncludeInSlicer` column. This slicer will have two values: "Include" and "Exclude". When you select "Include", it will filter the data as per your requirements.

Please note that you need to replace `"5"` with the actual threshold value you want to use.

I hope this helps! Let me know if you have any other questions.

Origem: conversa com o Bing, 12/10/2023
(1) Using field parameters and calculation groups for conditional .... https://www.sqlbi.com/articles/using-field-parameters-and-calculation-groups-for-conditional-formatt....
(2) IF and SELECTEDVALUE with multiple conditions. https://community.fabric.microsoft.com/t5/Desktop/IF-and-SELECTEDVALUE-with-multiple-conditions/m-p/....
(3) powerbi - Power BI slicer OR condition - Stack Overflow. https://stackoverflow.com/questions/63241081/power-bi-slicer-or-condition.
(4) Slicer with AND condition in Power BI - RADACAD. https://radacad.com/slicer-with-and-condition-in-power-bi.
(5) Using OR conditions between slicers in DAX - SQLBI. https://www.sqlbi.com/articles/using-or-conditions-between-slicers-in-dax/.

Hi,

 

Thank you so much, the problem is I want "5" to be dynamically supplied by the slicer control, not hard coded.

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.