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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors