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.
I am looking for a way to make selections from 2 slicers to populate a scatter chart by utilizing OR logic, not AND logic.
Slicer A (Store List, Active stores)
Store 1
Store 2
Store 4
Slicer B (Store List, Inactive stores)
Store 3
Store 5
If I were to select Store 1 from Slicer A and Store 3 from Slicer B, I would want to see 2 dots on my Scatter Chart (their X/Y coordinates). I've simplified the scenario here and do need two separate slicers.
Please let me know what approach you would take. Thank you!
Solved! Go to Solution.
Hi @akarasick1 ,
We can use VALUES function not use SELECTEDVALUE function to meet your requirement. The new measure like this,
Measure =
var _select_SlicerA = VALUES('Slicer A'[Store List])
var _select_SlicerB = VALUES('Slicer B'[Store List])
return
IF(MAX('Table'[Store List]) in _select_SlicerA||MAX('Table'[Store List]) in _select_SlicerB,1,0)
The remaining steps are the same as before.
If you have any question, please kindly ask here and we will try to resolve it.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @v-zhenbw-msft, @akarasick1 If one of the slicers is coming from a table with an inactive relationship then how would you modify the DAX?
Hi @akarasick1 ,
You can create two tables, one contains active store, another contains inactive store. And create a slicer based on them.
Then you can refer the following steps based on our sample.
1. Create two tables to be slicer.
Slicer A = CALCULATETABLE(DISTINCT('Table'[Store List]),'Table'[State]="Active stores")
Slicer B = CALCULATETABLE(DISTINCT('Table'[Store List]),'Table'[State]="Inactive stores")
2. Then we can create a measure and put it in Filter on this visual.
Measure =
var _select_SlicerA = SELECTEDVALUE('Slicer A'[Store List])
var _select_SlicerB = SELECTEDVALUE('Slicer B'[Store List])
return
IF(MAX('Table'[Store List])=_select_SlicerA||MAX('Table'[Store List])=_select_SlicerB,1,0)
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This looks great! How would I amend this to be able to handle multiple selections within the slicer - right now it only works with one selection.
Thank you!
Hi @akarasick1 ,
We can use VALUES function not use SELECTEDVALUE function to meet your requirement. The new measure like this,
Measure =
var _select_SlicerA = VALUES('Slicer A'[Store List])
var _select_SlicerB = VALUES('Slicer B'[Store List])
return
IF(MAX('Table'[Store List]) in _select_SlicerA||MAX('Table'[Store List]) in _select_SlicerB,1,0)
The remaining steps are the same as before.
If you have any question, please kindly ask here and we will try to resolve it.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |