Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jake_Neyu
Frequent 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).
 
Jake_Neyu_0-1653466245540.png

 

 
3 REPLIES 3
v-yanjiang-msft
Community Support
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

v-yanjiang-msft
Community Support
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 _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

following

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.