cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Using OR Logic on 2+ Slicers to Populate Scatter Chart

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Using OR Logic on 2+ Slicers to Populate Scatter Chart

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.

 

using1.jpg

 

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.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Using OR Logic on 2+ Slicers to Populate Scatter Chart

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")

 

USing1`.jpg

 

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)

 

using2.jpg

 

using3.jpg

using4.jpg

 

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.

Highlighted
Frequent Visitor

Re: Using OR Logic on 2+ Slicers to Populate Scatter Chart

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!

Highlighted
Community Support
Community Support

Re: Using OR Logic on 2+ Slicers to Populate Scatter Chart

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.

 

using1.jpg

 

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.

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors