Forum Discussion
or logic slicer
Is there a way to implement OR logic between 2 slicers?
I have a table with multiple columns and I want to be able to see items that meet either of the 2 criteria.
Example:
Type Color Other columns....
A Red
A Blue
A Green
B Red
B Red
B Green
I want to see anything on my resulting chart that is EITHER red OR Type A (5 results here). My graphs still need to maintain all of the data from the "other columns," like a regular slicer, so I can't just get an overall sum.
Thanks.
7 Replies
- StachuCommunity Champion
if you create a new, separate tables for Color & Type, and use them for slicers (without joining them with original table), then this syntax should work:
Measure = VAR Summary = SUMMARIZE(ALL('Table'),'Table'[Color],'Table'[Type]) VAR FilteredSummary = FILTER( Summary, [Color] IN VALUES(Color[Color]) || [Type] IN VALUES('Type'[Type]) ) RETURN CALCULATE(SUM('Table'[Value]),FilteredSummary)replace the blue syntax with whatever measure you want to show on the visuals
- sp8Helper II
Thanks.
Once I changed SUM to COUNT, I was able to get it working on visuals that only used fields from that original table.
As soon as I added a field from a different table (with relationship to the first), the filter was basically removed and the table went back to showing all of the data.
I tried adding the measure to a slicer so that I could force it to only see where the measure was 1, but that's apparently not allowed.
Any further suggestions?
- v-jiascu-msftMicrosoft Employee