Forum Discussion
powerdev
8 years agoRegular Visitor
IF Distinct
Hi Team, I work in the healthcare industry, and it is important that we obfuscate aggregated patient results if they result in <= 10. So my viz is using a calculated measure of DISTINCTCOUNT...
- 8 years ago
Well after fighting this for a while, I noticed that I needed to control with a between statement to avoid zero values and then everything worked fine.
Solution:
# of Patients = IF(DISTINCTCOUNT('TableName'[Patient Id]) > 0 && DISTINCTCOUNT('TableName'[Patient Id]) <= 10, 5, DISTINCTCOUNT('TableName'[Patient Id]))Maybe this can help someone else.
Anonymous
8 years agoNot applicable
Not sure if this will help, but try precalculating the measure as a variable so that it doesn't have to evaluate twice.
Obfuscated Measure =
VAR Test =
DISTINCTCOUNT(TableName[Patient ID])
RETURN
IF(
Test <= 10,
5, // Obfuscating
Test
)
Also, this may have just been a typo, but you were missing a few ")" in your code.