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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
adriansuteu
Advocate I
Advocate I

Count and Countrows returning the wrong figure

Hi.

 

I have a table that contains ~2900 rows with columns. You can see it in the screenshot below.

 

I am trying to count the orders (each order has a row in this table) and create visualizations based on the figures.

 

The problem is that the formulas return strange values:

Measure = countrows('Orders') returns 50

Measure = count('Orders'['Count']) returns 50 (after creating the column Count=1)

Measure = calculate(countrows('Initial Orders'),all('initial orders'))  returns the right number, but then if I add Axis (categories of products) I get the same figure for each value.

 

Please help me figure this out.

 

Thanks.

 

table1.png

1 ACCEPTED SOLUTION

Hi.

 

I solved the problem.

I guess it was some kind of bug.

 

All I did was to copy the source data (the whole table as it is), from a multiple sheet xlsx to a csv file and then use that file as source. And now everything works fine, COUNT, COUNTA and COUNTROWS.

 

Thanks for your interest!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I faced the same issue.

 

I have country names in a column and I need to count the number of times they appear.

 

I used the following DAX to count the number of times they appear in the table -:

 

Matches Won = COUNT('Cricket Data'[Winner])
 
But, it gave me a terrible result when I put it against the country names. It actually gave me the number of times they appear in "Country" column rather than giving it from the "Winner" column.
 
I think its a bug.
 
Please fix this ASAP.
Anonymous
Not applicable

Hi @adriansuteu,

 

Can you share the sample file to test? I can't find the columns which you used in the formula.

In addition, can you provide some detail content of your opertions? It will be help for troubleshooting.

 

Regards,
Xiaoxin Sheng

Hi.

 

I solved the problem.

I guess it was some kind of bug.

 

All I did was to copy the source data (the whole table as it is), from a multiple sheet xlsx to a csv file and then use that file as source. And now everything works fine, COUNT, COUNTA and COUNTROWS.

 

Thanks for your interest!

Anonymous
Not applicable

Even if I run the same formula by changing the data source to csv... The error remains as it was before...
Vvelarde
Community Champion
Community Champion

@adriansuteu

 

Hi, Are you applied some kind of filter or slicer in your page?

 

 

 

 




Lima - Peru

hello,

 

I am experiencing the same issue. CountA, CountAX, Countrows retutning the wrong count of numbers in my pbix file. Do I have to separate the source files as the result is an error

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.

Top Solution Authors