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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
bdeluca
Frequent Visitor

Filter matrix based on single value

Thanks ahead of time for the help.

 

bdeluca_0-1615912968483.png

I would like to filter out any employee if ALL entries are "-GOOD-". However, if even one entry is not "-GOOD-", he/she should not be filtered. The matrix is populated with this measure:

 

missing_hours = IF('Metrics_TimeEntry'[Total Hours] >38, "-GOOD-", IF(ISBLANK('Metrics_TimeEntry'[Total Hours]),0,'Metrics_TimeEntry'[Total Hours]))
 
I also created this measure in a (failed) attempt to filter:
 
missing_hours_filter = IF(CALCULATE('Metrics_TimeEntry'[Total Hours],FILTER('Dates', WEEKNUM('dates'[Date],2)))>38,0,1)

 

My idea was that if sum[missing_hours_filter] > 0 , then that employee would not be filtered out of the matrix.....but that doesn't work.

2 REPLIES 2
lbendlin
Super User
Super User

Remember that measures are calculated for every element of your visual separately.  For a matrix visual that means four different calculations: cell, row totals, column totals, and grand total.  In your case you need to write a measure that calculates the row total based on all the column values for that row.  That means you need to use an aggregator function.  

if you want more guidance please post sample data in usable format (not as a picture).

Here is a link to a sample dataset. The measures, tables, etc. are titled just as they are above.

 

https://drive.google.com/file/d/1TDVmGQcTQNk6-3f7XyKgAC33X2u8K87k/view?usp=sharing

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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