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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

can not get the correct value using countrows(filter( ))

Hello!

 

I used Number=countrows(filter(table1, event="sold"), I got a blank value.

 

However if I create a new table firstly Newtable=filter(table1, event="sold"), and then Number=countrows(Newtable), it works and gets the correct number. I can not understand this! could someone help me! Thanks!

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

please try this measure,

Number = countrows(filter('Table', 'Table'[type]="sold"))

vxiaotang_0-1665741399294.png

if you want to put it into table visual, please  try this measure,

Measure = countrows(filter(ALL('Table'), 'Table'[type]="sold"))

vxiaotang_1-1665741486779.png

If you are interested in the difference between the two, you can read the context

Context in DAX Formulas (microsoft.com)

Solved: contexts in power bi - Microsoft Power BI Community

Row Context and Filter Context in DAX - SQLBI

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

please try this measure,

Number = countrows(filter('Table', 'Table'[type]="sold"))

vxiaotang_0-1665741399294.png

if you want to put it into table visual, please  try this measure,

Measure = countrows(filter(ALL('Table'), 'Table'[type]="sold"))

vxiaotang_1-1665741486779.png

If you are interested in the difference between the two, you can read the context

Context in DAX Formulas (microsoft.com)

Solved: contexts in power bi - Microsoft Power BI Community

Row Context and Filter Context in DAX - SQLBI

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Use Calculate(Countrows(Table1),filter(table1, event="sold"))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.