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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
P0werBIn00b
Helper I
Helper I

DAX forumla returning different result

Edit: Sorry I gave the wrong DAX formulas. I have updated the DAX that I have used.

I have a table with 326 rows (no null rows )and an "Id" Column with 326 distinct values. From what I understand, Both of the DAX I have written should have the same result. But One returns 326 and One returns 327. What is happening?

The First DAX is :
Total Respondents = COUNTROWS(all(employedRespondents)) == returns 327


Second DAX :
All Total Respondents=

CALCULATE(COUNTA(employedRespondents[Id]),ALLEXCEPT(employedRespondents,employedRespondents[Id]))
returns 326

P0werBIn00b_0-1683621276442.png

 

 


Result of Two DAX:

P0werBIn00b_1-1683621276789.png

 

And No there are no blank rows on the table (326 rows and 326 distinct ID from 1 to 326).

3 REPLIES 3
tamerj1
Super User
Super User

Hi @P0werBIn00b 
Seems like the total number of rows of the table is 327 but the column [Id] has only 326 distinct values which means that one value has a duplicate.

ValtteriN
Super User
Super User

Hi,

One of the possible explanations that comes to mind is that you have a row containing empty id value on your data. Since COUNTA counts nonblank values and COUNTROWS counts all the rows this would be a logical explanation. Additionally, you are referring to different tables in your calculation: employedRespondents, espondentsDemographic

There could also be an issue with your relationships. Perhaps the Id is not correct in both tables.


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Sorry, The First DAX is

Total Respondents = COUNTROWS(all(employedRespondents)) == returns 327


Second DAX : All Total Respondents=

CALCULATE(COUNTA(employedRespondents[Id]),ALLEXCEPT(employedRespondents,employedRespondents[Id]))
returns 326

P0werBIn00b_1-1683527927183.png

 



Result of Two DAX:

P0werBIn00b_3-1683528101445.png

And No there are no blank rows (326 distinct ID from 1 to 326).

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.