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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pavel_Ischenko
Regular Visitor

Orthogonal filtering

Hello guys!

Is there anybody knows how to implement so called "orthogonal" filtering in PBI. What I mean here.

This is data visual. There are hundreds of products tested in hundreds locations. In the table you can see the results of testing. How easily to filter those locations (TRLID), where only 3 selected products were tested together? If select manually it should be second and fourth stripe from the bottom:

Pavel_Ischenko_1-1634678177385.png

 

 

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Pavel_Ischenko ,

 

Try to create this measure

Measure = 
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Result] ),
        FILTER ( ALLSELECTED ( 'Table' ), [TRILD] = MAX ( 'Table'[TRILD] ) )
    )
VAR _count2 =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[HGHNM] ), ALLSELECTED ( 'Table' ) )
RETURN
    IF ( ISFILTERED('Table'[HGHNM])&&_count = _count2, 1 )

Then put the measure into Filters and set as follows

2.png

When filtering, see the results

3.png

 

Best Regards,

Stephen Tao

 

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

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @Pavel_Ischenko ,

 

Try to create this measure

Measure = 
VAR _count =
    CALCULATE (
        COUNT ( 'Table'[Result] ),
        FILTER ( ALLSELECTED ( 'Table' ), [TRILD] = MAX ( 'Table'[TRILD] ) )
    )
VAR _count2 =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[HGHNM] ), ALLSELECTED ( 'Table' ) )
RETURN
    IF ( ISFILTERED('Table'[HGHNM])&&_count = _count2, 1 )

Then put the measure into Filters and set as follows

2.png

When filtering, see the results

3.png

 

Best Regards,

Stephen Tao

 

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

 

Thanks a lot! It works.

AlexisOlson
Super User
Super User

What do your data table(s) look like?

Hello.

Table is like

Pavel_Ischenko_0-1634755825194.png

 

Create a new calculated table to use as your slicer and column values for the matrix.

Slicer  = VALUES ( Table1[HGHNM] )

 

Then define a measure to check whether the set of selected products is the same as the set of products for the given TRLID.

ResultSliced =
VAR SlicerValues = ALLSELECTED ( Slicer[HGHNM] )
VAR TRLValues = VALUES ( Table1[HGHNM] )
VAR SharedCount = COUNTROWS ( INTERSECT ( SlicerValues, TRLValues ) )
RETURN
    IF (
        COUNTROWS ( SlicerValues ) = SharedCount && COUNTROWS ( TRLValues ) = SharedCount,
        CALCULATE ( SUM ( Table1[Result] ), Table1[HGHNM] IN VALUES ( Slicer[HGHNM] ) )
    )

 

Note: I check set equality here by taking the intersection of the two sets and checking if that has the same cardinality as each of the sets being intersected. If both A and B only contain values from A ∩ B, then these sets much be equal.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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