cancel
Showing results for
Did you mean:
Frequent Visitor

## Include Slicer1 values & Exclude Slicer B values

Slicer1 selected values should be in the visuals. However, slicer 2 selected values should be excluded from the visuals. Is this possible? and is it possible from this, to have a list of the customers who survived both purges? tahnk you.

For example, i want all customers who bought B but never bought C. Thank you. !

1 ACCEPTED SOLUTION
Community Support

First create another table for slicer2:

Then apply the measure to the visual level filter:

``````Measure =
var _a = ADDCOLUMNS(FILTER(ALL('Customer purchase'),'Customer purchase'[Customer]=MAX('Customer purchase'[Customer])),"Flag",IF([Product bought] in SELECTCOLUMNS('Product List',"Excluded",[Product list]),1,0))
var _b = SUMX(_a,[Flag])
return IF(_b>0,1,0)``````

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Community Support

First create another table for slicer2:

Then apply the measure to the visual level filter:

``````Measure =
var _a = ADDCOLUMNS(FILTER(ALL('Customer purchase'),'Customer purchase'[Customer]=MAX('Customer purchase'[Customer])),"Flag",IF([Product bought] in SELECTCOLUMNS('Product List',"Excluded",[Product list]),1,0))
var _b = SUMX(_a,[Flag])
return IF(_b>0,1,0)``````

Final output:

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

Hey, thank you, this is very good. If I wanted to add an AND logic to both slicers instead of an OR logic, would it be possible? Thank you again ! @v-jianboli-msft

Community Support

Can you please explain exactly what kind of AND logic you want?

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

if anyone has any other help to offer, it would be very kind ,thank you!

Super User

@thefunnyenterta , preferably slicer 2 should be on an independent date table

Measure =

var _tab = except(allselected(Table1[Column]), allselected(Slicer2[Column]))

return

calculate(Sum(Table[Value]), filter(Table1, Table[Column1] in _tab ))

Frequent Visitor

hey @amitchandak, it does not let me filter by Table[Column1] in tab.

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors