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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
CarlsBerg999
Helper V
Helper V

Sum all except selected value

Hi,

 

I'm having issues calculating a simple sum for all values except for the selected value. For some reason the DAX formula only accepts the sum for the selected value but not for the opposite:

 

This works:

CALCULATE(SUM(['Table1' [Column1]),

FILTER(Table1,Table1[Column2]=SELECTEDVALUE(Table2[Column4])

 

This doesn't work:

CALCULATE(SUM(['Table1' [Column1]),

FILTER(Table1,Table1[Column2]<>SELECTEDVALUE(Table2[Column4])

 

Why is this and how to fix this?

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @CarlsBerg999 

According to your description, I think if the second measure can work is based on the relationship between your ‘Table1’ and ‘Table2’, if they have a relationship, then I think you can change the DAX formula of your second measure like this to make it work:

Measure=

CALCULATE(SUM(['Table1' [Column1]),

FILTER(ALL(Table1),Table1[Column2]<>SELECTEDVALUE(Table2[Column4])

 

More info about the ALL() function in DAX

 

If they don’t have a relationship, I think both the two measures can normally work.

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @CarlsBerg999 

According to your description, I think if the second measure can work is based on the relationship between your ‘Table1’ and ‘Table2’, if they have a relationship, then I think you can change the DAX formula of your second measure like this to make it work:

Measure=

CALCULATE(SUM(['Table1' [Column1]),

FILTER(ALL(Table1),Table1[Column2]<>SELECTEDVALUE(Table2[Column4])

 

More info about the ALL() function in DAX

 

If they don’t have a relationship, I think both the two measures can normally work.

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

amitchandak
Super User
Super User

@CarlsBerg999 , If Table1 and Table2 are not connected both should work

 

Or try like


CALCULATE(SUM(['Table1' [Column1]),

FILTER(all(Table1),Table1[Column2]<>SELECTEDVALUE(Table2[Column4])))

 

check the diff in such calculation with and without independent table

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.