Forum Discussion
DistinctCount with filters
- 9 years ago
Hi ozlemv,
You use the IFERROR function in your formula, you create a calculated column based on my understanding.
IFERROR(A,B) := IF(ISERROR(A), B, A)
The following sub-formula in your formula is right. When the vTable1[Actuals]>X is ture, it will return a value, if the value of vTable1[Actuals] is 0, it will return 0, so the formula will return 0.CALCULATE( DISTINCTCOUNT(vTable1[CompanyID]),filter(vTable1,vTable1[Actuals]>X))
As Mi2n posted, you will get the expected result using the solution given.
If you have any other issue, please describe it clearly and sample data for further analysis.
Best Regards,
Angelia
My guess is, you have a calculated value for X instead of a fixed value. Is that right?
Hi all,
Thanks for your replies.
Actually X is a fixed number. Let's say it's 10000. The formulation is working when X equals to zero, but not with any other number.
- v-huizhn-msft9 years agoMicrosoft Employee
Hi ozlemv,
You use the IFERROR function in your formula, you create a calculated column based on my understanding.
IFERROR(A,B) := IF(ISERROR(A), B, A)
The following sub-formula in your formula is right. When the vTable1[Actuals]>X is ture, it will return a value, if the value of vTable1[Actuals] is 0, it will return 0, so the formula will return 0.CALCULATE( DISTINCTCOUNT(vTable1[CompanyID]),filter(vTable1,vTable1[Actuals]>X))
As Mi2n posted, you will get the expected result using the solution given.
If you have any other issue, please describe it clearly and sample data for further analysis.
Best Regards,
Angelia