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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Bando95
Frequent Visitor

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
Bando95
Frequent Visitor

Hello @tamerj1 

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

tamerj1
Super User
Super User

Hi @Bando95 

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.