Forum Discussion
EZV12
5 years agoHelper IV
DAX formula Distinct/Distinctcount
Dear all, I need to calculate the total number of customers for "Estimated Sales = SALES+FIRM ORDERS+FORECAST". I applied a formulas DAX to calculate the sum of customers of the 3 categories below,...
- 5 years ago
Hey EZV12 ,
you have to combine the columns first and then count the distinct values.
Try the following measure:
Amount Distinct Customers = COUNTROWS ( DISTINCT ( UNION ( VALUES ( 'FIRM ORDERS'[Customer Code] ), VALUES ( FORECAST[Customer Code] ), VALUES ( SALES[Customer Code] ) ) ) )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
selimovd
5 years agoMost Valuable Professional
Hey EZV12 ,
you have to combine the columns first and then count the distinct values.
Try the following measure:
Amount Distinct Customers =
COUNTROWS (
DISTINCT (
UNION (
VALUES ( 'FIRM ORDERS'[Customer Code] ),
VALUES ( FORECAST[Customer Code] ),
VALUES ( SALES[Customer Code] )
)
)
)
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
EZV12
5 years agoHelper IV
Hello Denis,
It works!! Thank you very much for your help!
Best regards
Rachel