Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
afaro
Helper III
Helper III

Taking set difference of slicer and values from one table to another

I have a slicer where you can select products - A, B, C, D, E. 

Let's say you select products A, B and you get a matrix/table with list of customers and the total sales made to them (non-zero values only). Let's say this is visual 1. 

 

Once I get this matrix/table with customer list, I want another table/matrix which shows me the total sales made to the same customers in visual 1 but with the remaining products not selected in the slicer i.e. for C, D, E. 

 

How can I approach this? 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @afaro ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1716791274002.png

Create a new table

Table 2 = VALUES('Table'[Prouct])

Create measres

Sales amount by Product = 
CALCULATE(
    SUM('Table'[Sales]),
    ALLEXCEPT(
        'Table',
        'Table'[Prouct]
    )
)
Measure 1 = 
IF(
    SELECTEDVALUE('Table'[Prouct]) IN VALUES('Table 2'[Prouct]) && [Sales amount by Product] <> 0,
    1,
    0
)
Measure 2 = 
IF(
    SELECTEDVALUE('Table'[Prouct]) IN VALUES('Table 2'[Prouct]),
    1,
    IF(
        [Sales amount by Product] = 0,
        1,
        0
    )
)

Appply measure 1 to visual 1 and measure 2 to visaul 2

vheqmsft_1-1716791416618.png

vheqmsft_2-1716791447154.png
Fianl output

vheqmsft_3-1716791470875.png

 

Best regards,
Albert He

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

2 REPLIES 2
Anonymous
Not applicable

Hi @afaro ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1716791274002.png

Create a new table

Table 2 = VALUES('Table'[Prouct])

Create measres

Sales amount by Product = 
CALCULATE(
    SUM('Table'[Sales]),
    ALLEXCEPT(
        'Table',
        'Table'[Prouct]
    )
)
Measure 1 = 
IF(
    SELECTEDVALUE('Table'[Prouct]) IN VALUES('Table 2'[Prouct]) && [Sales amount by Product] <> 0,
    1,
    0
)
Measure 2 = 
IF(
    SELECTEDVALUE('Table'[Prouct]) IN VALUES('Table 2'[Prouct]),
    1,
    IF(
        [Sales amount by Product] = 0,
        1,
        0
    )
)

Appply measure 1 to visual 1 and measure 2 to visaul 2

vheqmsft_1-1716791416618.png

vheqmsft_2-1716791447154.png
Fianl output

vheqmsft_3-1716791470875.png

 

Best regards,
Albert He

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

 

 

tamerj1
Super User
Super User

Hi @afaro 
It depends. How many products do you have in your real data? Can you provide a small dammy sample to work with?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.