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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Filtering on a Matrix

Hi,

 This may be a simple solutuion, I dont use Power BI much. I'll include a sample of the issue. In a matrix, is there any way to only show rows if it has certain criteria? 

Here is the underlying data

tangerinemdr15_0-1649683566681.png

 

Here is the matrix:

tangerinemdr15_1-1649683599267.png

I want to only show the highlighted ones because it has both alt and reg. 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

Ah, I see... But always up for a challenge. Try this as a filter:

FILTER 2 =
IF (
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Payment Type] ),
        ALLEXCEPT ( 'Table', 'Table'[Claim #] )
    ) = 2,
    1,
    IF ( MAX ( 'Table'[Payment Type] ) = "ALT", 1 )
)

filter rows1.jpg

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
PaulDBrown
Community Champion
Community Champion

Here is one way. Create an unrelated table using:

 

Reference table = SUMMARIZE('Table','Table'[Claim #],'Table'[Payment Type])

refernce table.jpg

 

 

Create a measure to use as a filter in the visual:

 

Filter =
VAR _ALT =
    CALCULATETABLE (
        VALUES ( 'Reference table'[Claim #] ),
        FILTER ( 'Reference table', 'Reference table'[Payment Type] = "ALT" )
    )
VAR _ALL =
    VALUES ( 'Table'[Claim #] )
RETURN
    COUNTROWS ( INTERSECT ( _ALT, _ALL ) )

 

Cretae the visual and add the [Filter] measure to the filter pane for the visual and set the value to 1

filter rows1.jpg

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you for your help @PaulDBrown . Unfortunately, I cant create a new table because its connected to a live database. I appreciate your time!

Ah, I see... But always up for a challenge. Try this as a filter:

FILTER 2 =
IF (
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Payment Type] ),
        ALLEXCEPT ( 'Table', 'Table'[Claim #] )
    ) = 2,
    1,
    IF ( MAX ( 'Table'[Payment Type] ) = "ALT", 1 )
)

filter rows1.jpg

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown thank you so much! This works! I appreciate your time!

amitchandak
Super User
Super User

@tangerinemdr15 , Try a measure like

Sumx(filter(summarize(Table, Table[Claim#], "_sum", sum(Table[Amount]) , "_cnt", calculate(DistinctCount(Table[Payment Type]), filter(Table, Table[Payment Type] in {"REG","ALT"} ))),[_cnt] =2), [_sum])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thank you so much! that was perfect! I realized, though, that I needed to modify my question. what would be the measure for this result? I would like to see only those with ALT and Reg or only ALT.  Sorry!

tangerinemdr15_0-1649705316793.png

 

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.