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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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 @Anonymous ,

 

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.

Anonymous
Not applicable

@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 @Anonymous ,

 

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.