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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

5 REPLIES 5
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.
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.