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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Measure counting rows using multiple filters using a related table

Hello,

 

I want to createt a COUNTROWS measure for 'IP_MAIN_VW' table that filters column 'IP_MAIN_VW[Discharge Hour]' with '<12' and filters in a related table 'IP_WARDS_VW[DISCH_WARD_CODE]' in {"DIS, "PLG"}.

 

I can create two separate measures that work OK:

 
1. CALCULATE(COUNTROWS(IP_MAIN_VW),IP_MAIN_VW[Discharge Hour]<12)
2. COUNTROWS(FILTER('IP_MAIN_VW',(RELATED(IP_WARDS_VW[DISCH_WARD_CODE]) IN {"DIS","PLG"})))

 

However, I want to combine these filters in one measure, is this possible? I've tried the below and the error states I have too many arguments in the COUNTROWS function. 

 

Any guidance would be great! 🙂

2 REPLIES 2
Anonymous
Not applicable

Hello @tamerj1 

Thank you for sharing your solution - this works perfectly! Muchos appreciado! 

tamerj1
Super User
Super User

Hi @Anonymous 

please try

=
COUNTROWS (
FILTER (
'IP_MAIN_VW',
IP_MAIN_VW[Discharge Hour] < 12
&& ( RELATED ( IP_WARDS_VW[DISCH_WARD_CODE] ) IN { "DIS", "PLG" } )
)
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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