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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
03clacey
New Member

ALLEXCEPT stops working as expected when i remove a field from my visual. What am i missing?

I'm trying to create a "Market Size" formula that calculates the relevant market size per brand. 

 

"Market Size" is considered as the sum of sales for all countries that brand is sold in.

 

Example: If a brand sells in the UK & France, i want to return the SUM of Sales for all brands within UK & France. 

 

I’ve been using ALLEXCEPT, and this works fine when I have the Country field in my visual, but if take it out of my table it no longer works as expected, and instead returns the SUM of Sales for the entire dataset, for every row in my visual. 

 

Every search I do comes back to ALLEXCEPT, but I’m clearly missing something, or using the wrong formula. 

 

My calculation is:

CALCULATE(    SUM('Sales'[Sales]),    ALLEXCEPT('Sales', 'Sales'[Country])    )

 

Any help would be greatly appreciated.

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

ALLEXCEPT is a rather blunt tool. Try something more surgical like REMOVEFILTERS.

View solution in original post

Deku
Super User
Super User

Var countries = values( 'Sales'[Country] )

Return

CALCULATE(

SUM('Sales'[Sales]),

ALLSELECTED(),

countries

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

5 REPLIES 5
v-nmadadi-msft
Community Support
Community Support

Hi @03clacey,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @03clacey ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @03clacey,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Deku
Super User
Super User

Var countries = values( 'Sales'[Country] )

Return

CALCULATE(

SUM('Sales'[Sales]),

ALLSELECTED(),

countries

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
lbendlin
Super User
Super User

ALLEXCEPT is a rather blunt tool. Try something more surgical like REMOVEFILTERS.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors