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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Column Subtotal Not Correct

I have a matrix like this:

Screenshot 2024-11-13 at 9.43.13 PM.png

The measure is Percent of Total Deal GCI Variance where I'm basically taking the percent of total deal GCI this year minus percent of total deal GCI from previous year:

 

Metric % Deal GCI Variance = DIVIDE (
    SUM ( 'Split Summary'[Deal GCI] ),
    CALCULATE (
        SUM ( 'Split Summary'[Deal GCI] ),
        ALLSELECTED ( 'Split Summary' )
    )
)
    - DIVIDE (
        SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
        CALCULATE (
            SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
            ALLSELECTED ( 'Split Summary' )
        )
    )

 


I'm suspecting the row totals are correct but not the column subtotals due to this measure using the ALLSELECTED() formula.  Is there any workaround to this?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@Anonymous 

 

Hi, isnt that your expected outcome? Of the deals greater than $2m...there is a variance of -5.57%... resulting from a -0.77% in Cali, -1.31% in Southeast and so on?

 

Doing some SUMIFs in Excel seems to validate the measure results. 

Screenshot 2024-11-14 153854.png

View solution in original post

saud968
Memorable Member
Memorable Member

To resolve this, you can replace ALLSELECTED() with ALL(). This function removes all filters from the measure context, allowing for correct calculation of subtotals across all dimensions.

Revised Measure:

Metric % Deal GCI Variance =
DIVIDE (
SUM ( 'Split Summary'[Deal GCI] ),
CALCULATE (
SUM ( 'Split Summary'[Deal GCI] ),
ALL ( 'Split Summary' )
)
)
- DIVIDE (
SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
CALCULATE (
SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
ALL ( 'Split Summary' )
)
)

Explanation:

ALL( 'Split Summary' 😞 This removes all filters from the Split Summary table, ensuring that the SUM operations are performed across all rows, regardless of the current filter context.
Subtotals: With this modification, the subtotals will now calculate the percent of total deal GCI variance correctly, considering the entire dataset without the influence of row or column filters.

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!


View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,
Based on the description, the DAX formula ahosakul  provided should be helpful.
Please view the method, if the method helps, please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Wisdom Wu

saud968
Memorable Member
Memorable Member

To resolve this, you can replace ALLSELECTED() with ALL(). This function removes all filters from the measure context, allowing for correct calculation of subtotals across all dimensions.

Revised Measure:

Metric % Deal GCI Variance =
DIVIDE (
SUM ( 'Split Summary'[Deal GCI] ),
CALCULATE (
SUM ( 'Split Summary'[Deal GCI] ),
ALL ( 'Split Summary' )
)
)
- DIVIDE (
SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
CALCULATE (
SUM ( 'Split Summary'[Deal GCI (Previous Year)] ),
ALL ( 'Split Summary' )
)
)

Explanation:

ALL( 'Split Summary' 😞 This removes all filters from the Split Summary table, ensuring that the SUM operations are performed across all rows, regardless of the current filter context.
Subtotals: With this modification, the subtotals will now calculate the percent of total deal GCI variance correctly, considering the entire dataset without the influence of row or column filters.

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!


Anonymous
Not applicable

@Anonymous 

 

Hi, isnt that your expected outcome? Of the deals greater than $2m...there is a variance of -5.57%... resulting from a -0.77% in Cali, -1.31% in Southeast and so on?

 

Doing some SUMIFs in Excel seems to validate the measure results. 

Screenshot 2024-11-14 153854.png

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors