Forum Discussion
Jake_Neyu
4 years agoFrequent Visitor
Unexpected result when using ALL within CALCULATE
I have 2 measures:
Measure 1: agent total all = CALCULATE(DISTINCTCOUNT(tms[agent]),all(tms[agent]))
Measure 2: agent total alls = CALCULATE(DISTINCTCOUNT(tms[agent]),ALLSELECTED(tms[agent]))
By logic, the result of Measure 1 should be >= the result of Measure 2 as Measure 1 removes all filters being applied on tms[agent] column while Measure 2 will keep all explicit filters. However, in this case, the result is the complete opposite where result of Measure 1 is less than the result of Measure 2 (see in picture).
3 Replies
- tamerj1
Community Champion
following
- v-yanjiang-msft
Community Support
Hi Jake_Neyu ,
According to your description, modify the formula like this:
agent total all = CALCULATE ( DISTINCTCOUNT ( tms[agent] ), ALL ( tms ) )Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-yanjiang-msft
Community Support
Hi Jake_Neyu ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj