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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.