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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
peterhui50
Helper III
Helper III

Filtering two different tables with OR

I am not sure what I am doing wrong, but there is the data model

 

peterhui50_0-1678212578800.jpeg

and there are the data that's in Table B and Table C - they are identical

 

TableB

peterhui50_1-1678212625801.jpeg

 

TableC

peterhui50_2-1678212650937.jpeg

 

I basically want to do a countrows of TableA, but with two criterias, that is if TableB[Count] = 1 OR TableC[Count]=2

It should return 1 row, because either of these are true.

 

When I write - 

CALCULATE( [Row_CountA], FILTER(B,B[Count]=1) || FILTER(C,C[Count] = 2))

it gives me an error and says

 

peterhui50_4-1678212964145.png

 

 

Is there a way to easily fix this? Thank you! much thanks in advance

 

 

 

 

 

 

1 ACCEPTED SOLUTION
peterhui50
Helper III
Helper III

This worked

 

Measure =

VAR Table_Test = SUMMARIZECOLUMNS(A[NAME], "B_Totals", SUM(B[Count]), "C_Totals", SUM(C[Count]))
RETURN
CALCULATE( [Row_CountA], FILTER(Table_Test, [B_Totals] = 1 || [C_Totals] = 2))
 
returned the value of 2 because there are two rows in table A, that matches the criteria of Table B totals = 1 OR Table C totals = 2

View solution in original post

1 REPLY 1
peterhui50
Helper III
Helper III

This worked

 

Measure =

VAR Table_Test = SUMMARIZECOLUMNS(A[NAME], "B_Totals", SUM(B[Count]), "C_Totals", SUM(C[Count]))
RETURN
CALCULATE( [Row_CountA], FILTER(Table_Test, [B_Totals] = 1 || [C_Totals] = 2))
 
returned the value of 2 because there are two rows in table A, that matches the criteria of Table B totals = 1 OR Table C totals = 2

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.