Forum Discussion
How to cound real distinct values?
Hello,
I am using this dax to calculate distinct values in a column:
EVALUATE
ROW (
"TagValue_Distinct",
DISTINCTCOUNT ( 'Dim_EA_Resource_TagKeys'[Value] )
)
and it is showing:
| 2660135 |
the issue is that that table has Date column which multiplies this number by 30 days:
How to evaluate the real number of disctint values in the column?
best,
Jacek
Hi jaryszek ,
I tried your approach and was able to reproduce the scenario on my end. By using your DAX expression with REMOVEFILTERS on the Date column, I was able to get the correct distinct count regardless of the selected date. This confirms that removing the date filter ensures the measure calculates the real distinct values across all dates, giving the expected output.
Please find the below attached .pbix file for your reference.
7 Replies
- PhilipTreacy
Super User
Not clear what the problem is or what your data is. Please supply sample data illustrating the problem.
Thx
Phil
- jaryszek
Super User
I want to check cardinality within Value column.
But Distinct count includes rows also with dates so the big number2660135
is shown per all dates.
What i need to to is to take distinct from Value column not looking for Date.
So result will be 30 times lower
Sorry there is no model there. Only 1 table. And question about 1 column.
Best,
Jacek- PhilipTreacy
Super User
Please show your data.
I don't understand how a Date column affects the Value column.
If the problem is simply that the result should be 30 times lower, why not just divide your distinct count by 30?
Phil