Forum Discussion
to sum distinct values
- 6 years ago
Hi Anonymous ,
Please try this formula. Or refer to the .pbix file.
Measure 2 = VAR x = CALCULATE( COUNT(prdoctypes[projectID]), FILTER( prdoctypes, prdoctypes[doctype] = MAX( prdoctypes[doctype]) ) ) RETURN IF( HASONEFILTER(prdoctypes[projectID]), x, COUNT(prdoctypes[projectID]) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Please create a measure like this.
Measure 2 =
CALCULATE(
COUNT(prdoctypes[projectID]),
ALLEXCEPT( prdoctypes, prdoctypes[doctype])
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hi v-lionel-msft ,
Thank you fo your support!
It works, but resource filter is supposed to work.
I added new values for testing and when I use your calculations, a filter is frozen
Can you see above differences in 'measure 2'? It appears the same at any time.
Could you please provide any options how to keep other filters?
BR,
Valeria
- v-lionel-msft6 years ago
Community Support
Hi Anonymous ,
Please try this formula. Or refer to the .pbix file.
Measure 2 = VAR x = CALCULATE( COUNT(prdoctypes[projectID]), FILTER( prdoctypes, prdoctypes[doctype] = MAX( prdoctypes[doctype]) ) ) RETURN IF( HASONEFILTER(prdoctypes[projectID]), x, COUNT(prdoctypes[projectID]) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.