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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
imocean
Frequent Visitor

Metrics column breaks filter in visual

Hi there,

I've got a quite simple data model where there is a Distributors table, and a Drivers table with lookup to distributor, and a ComplianceRecords table containing all the compliance each driver needs to meet and the current status (Yes or No). So I created a measure to show the compliance rate i.e. 

%Compliance = If(COUNTROWS(Filter(compliancerecord,compliancerecord[compliancestatus]="Yes"))=0,0,COUNTROWS(Filter(compliancerecord,compliancerecord[compliancestatus]="Yes")) / CALCULATE(COUNT(compliancerecord[compliancerecordid]), ALLSELECTED(compliancerecord[compliancestatus])))

 

 

However when I try to filter on some attibute say State (in Distributor table), if I add %Compliance measure in the visual the rows are not filtered to show only Drivers relevant to the selected State (the table visual on left shows correct filtered rows, while the right doesn't).  How can I make the filtering working with the metrics meassure column? 

 

imocean_1-1616882182910.png

 

Could be an easy question to many! 

 

Thanks a lot

 

 

1 ACCEPTED SOLUTION
imocean
Frequent Visitor

Got it working - I created custom column on Drivers table to calculate each Driver's metrics. By doing that it filters off those not relevant to the filters. Not sure if it's the best way though. 

View solution in original post

3 REPLIES 3
imocean
Frequent Visitor

Got it working - I created custom column on Drivers table to calculate each Driver's metrics. By doing that it filters off those not relevant to the filters. Not sure if it's the best way though. 

imocean
Frequent Visitor

Thanks very much @jdbuchanan71 . I tried separating to 3 measures but it does the same. The main challenge is that I want to display 0% as well, so with your method I changed on the Compliant % to be

 

Compliant % = IF( [Compliant Count] = 0, 0, DIVIDE ( [Compliant Count], [All Selected Count] ))

 

However adding the 0% made all the rows visible in the visual. 

jdbuchanan71
Super User
Super User

@imocean 

Can you try it with 3 measures?

All Selected Count = CALCULATE ( COUNTROWS ( compliancerecord ), ALLSELECTED ( compliancerecord[Status] ) )
Compliant Count = COUNTROWS ( FILTER ( compliancerecord, compliancerecord[status] = "Yes" ) )
Compliant % = DIVIDE ( [Compliant Count], [All Selected Count] )

That way you also have the count measures available for use in visuals.

jdbuchanan71_0-1616892362110.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors