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
Mahi1827
Resolver I
Resolver I

How to filter (show/hide) slicer values, based on selection of value from another slicer

Hi ,

Need your help and suggestions on below problem.

I have 2 slicers one is "country" and another one is "price type" 

 

country slicer have values US,UK,JP
and price type slicer have values "new price", "old price", "offer price"

 

as per the requirement, i would like show or hide values in price type slicer based on selection of value in country slicer. below scenarios i need cover.

 

1) if country "US" is selected in country slicer then price type slicer should show only "new price"
2) if country "UK" is selected in country slicer then price type slicer should show only "new price" and "old price"
3) if country "JP" is selected in country slicer then price type slicer should show only "new price" and "offer price"

 

i have tried with creating new column to get values in price type slicer = if ( isfilterted(Product[country]="US", filter(product,product[price type]="new price",
Product[country]="UK", filter(product,product[price type]="new price" && product,product[price type]="old price",
Product[country]="JP", filter(product,product[price type]="new price" && product,product[price type]="offer price","")))

 

also tried with creating new measure= var selectvalue(product[country]="US" and applied on price type slicer but both new column and measures not worked with DAX

 

so please suggest your approach on DAX or any other workaround and help on this scenario.

 

Thanks for your time.

 

Thanks
mahi

2 REPLIES 2
Anonymous
Not applicable

This is a challenging one without knowing more about your model like @mattww eluded to.  I'm guessing you don't have relationships built in since you are having problems.  I would like to ask though, is your intention with the PriceType slicer to display the appropriate pricing from another table with that data?  If so, you could probably use a calculation group instead of list of values for your slicer.  Just a thought.

mattww
Responsive Resident
Responsive Resident

Hi @Mahi1827 

 

Is this based on one table or are the fields Country and Price Type on separate tables associated with another table you're aggregating?

 

You could create a COUNTROWS measure on the table that's being aggregated, drag that as a Visual Level Filter on your Price Type slicer, and set the filter to be > 0

 

This article is the kind of thing I mean Filter slicers without using bidirectional filters in Power BI - SQLBI

 

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

 

 

 

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.