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
cosminc
Post Partisan
Post Partisan

column countrows from Related Table

Hi all,

please can you help me with the right syntax?

2 tables: table 1 and table2

for table 2 i need to countrows from table 1 - related table but i need also to include 2 adjust table 1 with 2 filters columnA = 1 && column B = 1

 

something like this:

CALCULATE(COUNTROWS(RELATEDTABLE(table1)), FILTER(table1, columnA = 1 && column B = 1))
 
Thanks,
Cosmin

 

 

 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
d_gosbell
Super User
Super User

Assuming that you are using this expression in a calculated column you might be able to do something like the following

 

CALCULATE(COUNTROWS( FILTER( RELATEDTABLE(table1), table1[columnA] = 1 && table1[column B] = 1))

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.