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
Anonymous
Not applicable

count

Hi, I would like to get the count of rows for column A when column B, which is year is 2019

i.e.

countofrows =
CALCULATE(
COUNTROWS('table1')
, 'table2'[Year] = 2019
)
 
What is wrong with this please?
1 REPLY 1
HotChilli
Super User
Super User

Do you have 1 table or 2 tables?

If you have 1, the count won't work because you are referring to 2 tables.

If you have 2 tables, you need a relationship set up correctly between them.

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.