Forum Discussion
COUNT or DISTINCTCOUNT?
What is the difference between COUNT and DISTINCTCOUNT?
Is one preferable?
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) :
Appreciate your Kudos
3 Replies
- MahyarTFMemorable 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) :
Appreciate your Kudos
- ribisht17Super User
Anonymous
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 - TomMartensSuper User
Hey Anonymous ,
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