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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ahmedshalabyy12
Resolver I
Resolver I

problem with all except

Dears,

 

I’m trying to display the total amount (8M) for each organization in every row of the matrix, but it’s not working as expected.

  • Org Name comes from Dim_Organizations

  • Recommended Amount comes from Fact_Table

  • Terms come from Dim_Terms

  • Rec Amount is supposed to display 8M in each row, but instead it’s splitting the value.

Can you please help me identify why this is happening and how to fix it?


Measure
Rec_Amount =
CALCULATE (
[Total Amount (Sum)],
ALLEXCEPT ( Organizations, Organizations[Organization Name] )
, ALLEXCEPT(Terms,Terms_years ) )

ahmedshalabyy12_0-1758928124829.png

 

1 ACCEPTED SOLUTION
Ahmed-Elfeel
Resolver II
Resolver II

Hi @ahmedshalabyy12,

 

The issue here that is you are applying this to two different tables which is causing unexpected behavior

 

Your current measure:

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALLEXCEPT ( Organizations, Organizations[Organization Name] ),
    ALLEXCEPT ( Terms, Terms[TermYears] )
)

This is saying "Remove all filters except Organization Name from the Organizations table AND remove all filters except TermYears from the Terms table (This creates conflicting filter contexts)

 

You need to use ALLEXCEPT on the fact table (or use a different approach) to ignore the TermYears filter while keeping the Organization Name filter

 

So you can use ALLEXCEPT on the fact table (if possible)

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALLEXCEPT ( Fact_Table, Organizations[Organization Name] )
)

 

Or use REMOVEFILTERS for more precise control

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    Organizations[Organization Name] = SELECTEDVALUE(Organizations[Organization Name]),
    REMOVEFILTERS ( Terms )
)

 

 

You can also ALL with VALUES (most reliable)

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALL ( Terms ),
    VALUES ( Organizations[Organization Name] )
)

 

This will:

  • Remove any filtering from the Terms table (including TermYears)

  • Preserve the current Organization Name filter

  • Show the total $8M for (Black Futures Lab) in every row of your matrix

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
FBergamaschi
Solution Sage
Solution Sage

The problem is that you are not removing the filter nor from Terms nor from Organization name

 

If you want to see 8M everywhere, you need to remove those filters, so please use this code (or a slight variation we might fix later)

 

Rec_Amount =
CALCULATE (
      [Total Amount (Sum)],
      REMOVEFILTERS( Organizations[Organization Name] ),
      REMOVEFILTERS( Terms_years )
)

 

If you want to remove filters from other columns, from those tables, you can list them in the rremovefilters call afer a comma

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Ahmed-Elfeel
Resolver II
Resolver II

Hi @ahmedshalabyy12,

 

The issue here that is you are applying this to two different tables which is causing unexpected behavior

 

Your current measure:

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALLEXCEPT ( Organizations, Organizations[Organization Name] ),
    ALLEXCEPT ( Terms, Terms[TermYears] )
)

This is saying "Remove all filters except Organization Name from the Organizations table AND remove all filters except TermYears from the Terms table (This creates conflicting filter contexts)

 

You need to use ALLEXCEPT on the fact table (or use a different approach) to ignore the TermYears filter while keeping the Organization Name filter

 

So you can use ALLEXCEPT on the fact table (if possible)

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALLEXCEPT ( Fact_Table, Organizations[Organization Name] )
)

 

Or use REMOVEFILTERS for more precise control

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    Organizations[Organization Name] = SELECTEDVALUE(Organizations[Organization Name]),
    REMOVEFILTERS ( Terms )
)

 

 

You can also ALL with VALUES (most reliable)

Rec_Amount =
CALCULATE (
    [Total Amount (Sum)],
    ALL ( Terms ),
    VALUES ( Organizations[Organization Name] )
)

 

This will:

  • Remove any filtering from the Terms table (including TermYears)

  • Preserve the current Organization Name filter

  • Show the total $8M for (Black Futures Lab) in every row of your matrix

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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