Forum Discussion
dannytan1112
3 years agoHelper I
Distinctcount exclude duplicates
Hi, I have a question to only distinct count values that is not duplicate. For example i have a column with "apple", "apple", "banana", "orange", and "cucumber". I want to return the value of 3 be...
- 3 years ago
Hi,
Thank you for your message.
I am not sure how your desired outcome of the visualization looks like, but please check the below picture and the attached pbix file.
Count distinct only measure: = COUNTROWS ( FILTER (DISTINCT( Data[Name] ), CALCULATE ( COUNTROWS ( Data ) ) = 1 ) )
dannytan1112
3 years agoHelper I
Hi,
Thanks for your very prompt help, although it shows no error but it produce blank row in my case.
Any idea where i might have mistaken?
Thank you so much
tamerj1
3 years agoCommunity Champion
Hi dannytan1112
Not sure about the current filter context but you may also try
Count =
SUMX (
ALLSELECTED ( 'Table'[Column] ),
IF ( COUNTROWS ( CALCULATETABLE ( 'Table' ) = 1, 1 )
)