Forum Discussion
Oscar_Mtz_V
Kudo Commander
4 years agoDistinct count of only the minimum value
This is my data table: Support.pbix I need to have a disctinc count of employees IDs but only count when the instance where they appear is less than or equal to three, and only count the minor ...
- 4 years ago
amitchandak , your response although not the solution, guided me through the right path.
The key here was the VAR selValue which applied the correct context when used in a Matrix and replaced the SUM for a MIN.Also, I didn't hard code the value "3", in its place I used a parameter.
Here is the final DAX that did the trick:
DCount GUID min with parameter = VAR selValue = SELECTEDVALUE('Append'[Standard Value]) VAR Calc= COUNTX( FILTER( SUMMARIZE( ALLSELECTED('Append'), 'Append'[Employee GUID], 'Append'[UniqueID], "Min", MIN('Append'[Standard Value]) ), [Min] <= [Parameter Value] && [Min] = selValue ), [Employee GUID] ) RETURN Calc
Anonymous
4 years agoNot applicable
Hi Oscar_Mtz_V ,
Here the selection is sum of instance.
It should be correct that the corresponding data in the table is 2.
If you want to show the distinct count, please select count(distinct).
If I misunderstood your meaning, please share more details.
Best Regards,
Jay
Oscar_Mtz_V
Kudo Commander
4 years agoAnonymous , it is a bit more complex than that, please see the thread of responses where the issue is explained.