Forum Discussion
Using slicer to filter out value from categorical visualizations
Hi,
I am looking to use a slicer based on a use case name field (i.e. Use Case 1, Use Case 2, ...). When a use case is selected from the slicer, all of the visualizations on the page should update to EXCLUDE that selected use case.
The visualizations would be based on categorical features of the use case - so if the Use Case is Lifecycle = Pilot, then I would want the Lifecycle visualization to show all other Pilot use cases by their risk rating.
I have included sample data and a sample output - because Use Case 6 is Production it filters the Lifecycle visual to all Production use cases that have a rating and are NOT Use Case 6. Similarly, because Use Case 6 is in the US it filters the Country visual to all US use cases that have a rating and are NOT Use Case 6.
| Use Case Name | Lifecycle | Country | Rating |
| Use Case 1 | Pilot | Nepal | Low |
| Use Case 2 | Production | US | Medium |
| Use Case 3 | Ideation | UK | High |
| Use Case 4 | Pilot | US | Low |
| Use Case 5 | Pilot | China | Medium |
| Use Case 6 | Production | US | |
| Use Case 7 | Pilot | UK | |
| Use Case 8 | Ideation | Nepal |
3 Replies
- ryan_mayu
Super User
- jtooke
Helper I
Thank you, this worked perfectly!
- AnonymousNot applicable
Hi jtooke ,
Thanks for reaching out to the Microsoft fabric community forum.
Try these measures
1. Get Metadata of the Selected Use Case
Create these measures:
a. Selected Lifecycle
Selected Lifecycle =
CALCULATE (
SELECTEDVALUE('YourTableName'[Lifecycle]),
FILTER('YourTableName', 'YourTableName'[Use Case Name] = SELECTEDVALUE(UseCaseSlicer[Use Case Name]))
)
b. Selected Country
Selected Country =
CALCULATE (
SELECTEDVALUE('YourTableName'[Country]),
FILTER('YourTableName', 'YourTableName'[Use Case Name] = SELECTEDVALUE(UseCaseSlicer[Use Case Name]))
)
2. Create Filtering Logic Measure
a. For Lifecycle Visual:
Show Similar Lifecycle Excluding Selected =
VAR SelectedUC = SELECTEDVALUE(UseCaseSlicer[Use Case Name])
VAR SelectedLC = [Selected Lifecycle]
RETURN
IF (
'YourTableName'[Use Case Name] <> SelectedUC &&
'YourTableName'[Lifecycle] = SelectedLC &&
NOT(ISBLANK('YourTableName'[Rating])),
1,
0
)
b. For Country Visual:
Show Similar Country Excluding Selected =
VAR SelectedUC = SELECTEDVALUE(UseCaseSlicer[Use Case Name])
VAR SelectedCountry = [Selected Country]
RETURN
IF (
'YourTableName'[Use Case Name] <> SelectedUC &&
'YourTableName'[Country] = SelectedCountry &&
NOT(ISBLANK('YourTableName'[Rating])),
1,
0
)If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team