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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
P0werBIn00b
Helper I
Helper I

Using Filter in field Parameters Value

Hello Community,
I was using Field Parameters as a slicer. The dax of my field parameters is as

P0werBIn00b_0-1694063121081.png

I create a slicer to select either Country, Product Category, or Product Sub Category.


All these columns also have multiple values. What I want to do Now is add another slicer which shows column values for country when country parameter is selected, Product Category when product category is selected and so on.

 

Note: In power BI desktop, if we add the parameter to slicer it adds my three parameter values Country, Product Category and Product sub categroy into slicer, But if I drag and drop parameter into chart and change it into slicer later it shows the column value for the selected parameter.

 

Now I have two slicer with same field parameter. One shows three values which I added in field parameter. Another slicer also has the same parameter but it shows the column values for the the parameter although they have the same field value. (I dont know why they are different?)

 

When I select country parameter another slicer shows all the list of countries. But if I dont select anything, the visuals shows all the countries in its visual. I want to show the visuals only when at least one value is selected from both visuals.

 

These are the dax I tried:

 

To check if any parameter is selected:

P0werBIn00b_2-1694063664008.png

 

To check if any filter is selected:

P0werBIn00b_1-1694063632471.png

 

I also tried this to check if any filter is applied:

test = IF(ISFILTERED('Country and Category Comparison'[Parameter]),1,0)

 

 

 

Can someone help please!!!

 

1 ACCEPTED SOLUTION

Hi @P0werBIn00b ,

 

Exercise File

Could you try below measure and apply it to your table?

If it's not working, please let us know more about the visual which you want to hide.

Selected2 = 
IF( 
CALCULATE(ISFILTERED('Table'[Sub Product]),ALLSELECTED('Table')) || 
CALCULATE(ISFILTERED('Table'[Product]) ,ALLSELECTED('Table')) || 
CALCULATE(ISFILTERED('Table'[Country]),ALLSELECTED('Table')), 1 , 0)

 

isjoycewang_0-1694159073431.png

 

View solution in original post

6 REPLIES 6
isjoycewang
Solution Supplier
Solution Supplier

Hi @P0werBIn00b ,

 

1. Please create a new shape on the visual you want to hide when the slicer is unselected.

2. Create below measure to define the visibility

*Change 'Table' to your TableName

Selected = 
IF( ISFILTERED('Table'[Sub Product]) || ISFILTERED('Table'[Product]) || ISFILTERED('Table'[Country]), "#FFFFFF00" , "White")

 3. Appy this measure to the color fx of your shape

isjoycewang_0-1694077507093.png

 

So it should be invisible when the slicer is unselected as below.

isjoycewang_1-1694077567888.png

isjoycewang_2-1694077588695.png

 

Hello @isjoycewang ,

I get what you are saying, but I wouldn't be able to click on anything on my visual, would I?

 

Hi @P0werBIn00b ,

 

Exercise File

Could you try below measure and apply it to your table?

If it's not working, please let us know more about the visual which you want to hide.

Selected2 = 
IF( 
CALCULATE(ISFILTERED('Table'[Sub Product]),ALLSELECTED('Table')) || 
CALCULATE(ISFILTERED('Table'[Product]) ,ALLSELECTED('Table')) || 
CALCULATE(ISFILTERED('Table'[Country]),ALLSELECTED('Table')), 1 , 0)

 

isjoycewang_0-1694159073431.png

 

Thank you @isjoycewang,

 

Worked like a charm,

But could you explain why my previous code didn't work and this did??

Hi @P0werBIn00b,

Since you're using this code in a table visual, the context inside the table should be considered as well.
More info about removing context filter, please refer to ALLSELECT function:
https://learn.microsoft.com/en-us/dax/allselected-function-dax

Hello @isjoycewang ,

Thank you for your response,

 

One last question,

 

With the above filter in visual. I also want to make the background transparent if visual is not available and white background if visual is available.

 

IsParameter Filtered = IF(CALCULATE(ISFILTERED('DV States'[Country]),ALLSELECTED('DV States')) || CALCULATE(ISFILTERED('DV Orders'[Product Category]),ALLSELECTED('DV Orders')) || CALCULATE(ISFILTERED('DV Orders'[Product Sub Category]),ALLSELECTED('DV Orders')),1,0)
 
background color = IF(([IsParameter Filtered])=1,"#FFFFFF","#FFFFFF00")
 
But it doesnt work??

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.