Forum Discussion
Slicer Selection WIth Filtered Data
Hey rehansaeed2468 ,
From the expected output screenshot, I am making an assumption that the Ratings will be at the stops of 0.0, 1.3, 1.9, 2.3 and 2.9 (if it is a continuous value, then you might want to go ahead with numeric range parameters). Anyway, the following is the setup with two disconnected tables (one for product A rating and other for product B rating) for slicers and one additional table to show the filtering work:
ProductRatingA =
DATATABLE(
"Product", STRING,
"Rating", STRING,
{
{"A", "0.0"},
{"A", "1.3"},
{"A", "1.9"},
{"A", "2.3"},
{"A", "2.9"}
}
)ProductRatingB =
DATATABLE(
"Product", STRING,
"Rating", STRING,
{
{"B", "0.0"},
{"B", "1.3"},
{"B", "1.9"},
{"B", "2.3"},
{"B", "2.9"}
}
)ProductDim =
DATATABLE(
"Product", STRING,
"Rating", STRING,
"ProductName", STRING,
"Description", STRING,
"UnitPrice", CURRENCY,
{
{"A", "0.0", "Product A - Rating 0.0", "Entry-level product with basic features", 10.00},
{"A", "1.3", "Product A - Rating 1.3", "Standard product with essential features", 15.50},
{"A", "1.9", "Product A - Rating 1.9", "Enhanced product with advanced features", 22.75},
{"A", "2.3", "Product A - Rating 2.3", "Premium product with superior quality", 29.99},
{"A", "2.9", "Product A - Rating 2.9", "Top-tier product with all features", 39.99},
{"B", "0.0", "Product B - Rating 0.0", "Entry-level product with basic features", 12.00},
{"B", "1.3", "Product B - Rating 1.3", "Standard product with essential features", 18.50},
{"B", "1.9", "Product B - Rating 1.9", "Enhanced product with advanced features", 25.75},
{"B", "2.3", "Product B - Rating 2.3", "Premium product with superior quality", 32.99},
{"B", "2.9", "Product B - Rating 2.9", "Top-tier product with all features", 44.99}
}
)And for the filter, we will create a measure that acts as visual level filter:
FilterProducts =
VAR SelectedRatingsA = VALUES(ProductRatingA[Rating])
VAR SelectedRatingsB = VALUES(ProductRatingB[Rating])
VAR CurrentProduct = SELECTEDVALUE(ProductDim[Product])
VAR CurrentRating = SELECTEDVALUE(ProductDim[Rating])
RETURN
IF(
(CurrentProduct = "A" && CurrentRating IN SelectedRatingsA) ||
(CurrentProduct = "B" && CurrentRating IN SelectedRatingsB),
1,
0
)Drag this measure to the filter pane under Filters on this visual (for the visual you want, table will be used as example) and set it to check if it is equal to 1:
Then you should have something like this:
Make changes as necessary.
Hope it helps!
Can you please attached the working PBIX file
- v-veshwara-msft7 months agoCommunity Support
Hi rehansaeed2468 ,
Thanks for reaching out to Microsoft Fabric Community.
Thanks alish_b for sharing the approach.
I recreated the same setup and verified the behavior against the expected output. The two rating slicers work independently for Product A and Product B, and the table reflects the combined selections correctly.
Attaching a working PBIX for reference.
Hope this helps. Please reach out for further assistance.
Thank you.- v-veshwara-msft6 months agoCommunity Support
Hi rehansaeed2468 ,
Just checking in to see if the PBIX shared above helps confirm the solution.
Please let us know if you are able to achieve the expected slicer behavior on your side.
Thank you.