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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PowerFabian
Frequent Visitor

Use COUNTROWS with multiple filter on related columns

Hey,

 

i have a problem with my measure. I try to use Countrows on a table based on two columns in a related table. 

 

I have a table "Receipts" (Many-side) and a table "Customers" (One-side) and they are in a Many-to-One relationship. So each receipt record has a column with a CustomerNo that has one record in my table Customer. Now I want to calculate the numer of receipts that meet the criteria of two columns in the related customer table.

 

For example I calculate the number of receipts that possess a customer number which has a address line like that:

Number with addressline= CALCULATE(COUNTROWS(Receipts), Customer[AddressLine]<>"")
--> this works fine for me, ISBLANK isn't a possible solution. but works with <>""
 
Now I want the number of receipts that possess a customer number that has a phone numer OR a mobilephone number in their record. I tried like that:
Number with any phonenumber = CALCULATE(COUNTROWS(Fact_Belege), Dim_Customer[FonPrivate1]<>"" || Dim_Customer[MobileFonPrivate])
 
--> now i get an error code that says expression contains multiple columns, but only one column can be used a true/false expression for a tablefilter. I also tried it with the OR() function, but without a result
 
Can you help me with that, because I dont know how to rewrite my measure.
 
Kind regards,
Fabian
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PowerFabian , Try a meausre like

 

Number with any phonenumber = CALCULATE(COUNTROWS(Fact_Belege), filter(Dim_Customer,not(isblank(Dim_Customer[FonPrivate1])) || not(isblank(Dim_Customer[MobileFonPrivate]))))

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

View solution in original post

3 REPLIES 3
pawel_osipowski
Frequent Visitor

Yes, known thing for CALCULATE as it's implicitly using FILTER which pulls logic values from one column: for solutions refer to this: https://www.sqlbi.com/articles/filter-arguments-in-calculate/

 

amitchandak
Super User
Super User

@PowerFabian , Try a meausre like

 

Number with any phonenumber = CALCULATE(COUNTROWS(Fact_Belege), filter(Dim_Customer,not(isblank(Dim_Customer[FonPrivate1])) || not(isblank(Dim_Customer[MobileFonPrivate]))))

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

Thank you very much for your help. It worked like that for me. 
Regards,

Fabian

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.