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

UNION to be applied after visual filtering (slicer)

Hi guys,
I have a long table of Products having various attributes - size, color, etc. I would like to have a matrix to "benchmark" (compare) particular product's attributes against according attributes of another small subset of products.
So, I duplicated my Products table to Products Benchmarks and then created a 'Union Table':

Union Table = UNION(Products, 'Products Benchmarks')
and created a visual matrix for this table.
I also created 2 slicers - one against Products to select single "benchmark" product and another against 'Products Benchmarks'. But currently they do not affect the matrix. What I want, is that the matrix should contain product selected by 1st slicer and subset of products selected by 2nd slicer (so the UNION should be basically applied to tables AFTER applying visual filtering).

The sample can be downloaded here:
https://1drv.ms/u/s!AtoFc8iRNnAHesiWHjvcvVBXEKU?e=rXUh7t
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @alexeybaukov ,

 

Please check:

 

1. Create a measure.

Measure =
IF (
    MAX ( 'Union Table'[Product Name] ) = SELECTEDVALUE ( Products[Product Name] )
        || MAX ( 'Union Table'[Product Name] )
            IN VALUES ( 'Products Benchmarks'[Product Name] ),
    1
)

 

2. Put it on "Filters on this visual" of your table visual.

measure.PNG

 

3. Test.

product.gif

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @alexeybaukov ,

 

The cause is that there is no relationship among your tables.

no relationship.PNG

 

Please Create and manage relationships in Power BI Desktop.

 

In addition, it is suggested to understand the Unpivot related content.

Then, you can create a matrix visual like so:

unpivot.PNG

 

 

 

Best Regards,

Icey

 

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

@Icey,
I'm not sure how relationship can solve my issue.
I assume, you meant 'Products' to 'Union Table' and 'Products Benchmarks' to 'Union Table' relationship in this case (both by Product Name field). If I do it this way, then the final visual (matrix for 'Union Table') shows the intersection of what's selected by 2 slicers (i.e. products selected in both slicers simultaneously), whereas I need the union of what's selected by 2 slicers (i.e. products selected in at least one of 2 slicers).

Icey
Community Support
Community Support

Hi @alexeybaukov ,

 

Please check:

 

1. Create a measure.

Measure =
IF (
    MAX ( 'Union Table'[Product Name] ) = SELECTEDVALUE ( Products[Product Name] )
        || MAX ( 'Union Table'[Product Name] )
            IN VALUES ( 'Products Benchmarks'[Product Name] ),
    1
)

 

2. Put it on "Filters on this visual" of your table visual.

measure.PNG

 

3. Test.

product.gif

 

Best Regards,

Icey

 

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
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors