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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jellis1971
Helper III
Helper III

COUNT or DISTINCTCOUNT?

What is the difference between COUNT and DISTINCTCOUNT?

 

Is one preferable?

1 ACCEPTED SOLUTION
MahyarTF
Memorable Member
Memorable Member

Hi,

If there is the same record, the count is counted as a one, but in DitinctCount the same columns are considered as one record (same as Distinct in Sql) :

MahyarTF_0-1660876132813.png

Appreciate your Kudos

 

Mahyartf

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey @jellis1971 ,

 

both functions do not answer the same question, for this reason none is preferable over the other.

Here you will an article about COUNT: COUNT – DAX Guide
Here you will find an article about DISTINCTCOUNT: DISTINCTCOUNT - DAX Guide

If you have a fact table containing three orders, from 2 different customers (2 orders from customer a, and 1 order from customer b).

COUNT( 'orders'[customer]) will return 3
DISTINCTCOUNT( 'orders'[customer]) will return 2

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
ribisht17
Super User
Super User

@jellis1971 

 

https://docs.microsoft.com/en-us/dax/distinctcount-function-dax

 

https://docs.microsoft.com/en-us/dax/count-function-dax

 

I ordered Soft-Drink Pepsi three times

 

So, distinct count of Softdrink will be 1 (Only one type of Soft-Drink)

But count of my order will be 3 because I ordered 3 times

 

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 
MahyarTF
Memorable Member
Memorable Member

Hi,

If there is the same record, the count is counted as a one, but in DitinctCount the same columns are considered as one record (same as Distinct in Sql) :

MahyarTF_0-1660876132813.png

Appreciate your Kudos

 

Mahyartf

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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