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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RENJITH_R_S
Resolver II
Resolver II

Total Calculation for Matrix Visual

Hello Friends, can you help me on this calculation, I have a matrix visual with 2 columns say Item having values A,B,C on the Row header and year having values 2023,2024 and 2025 as column header and I have a measure which captures some numeric value on the Values. see the screenshot . I want that measure to be update such a way that it should the values of A for these 3 years and in the total part these values not be considered (Total = Sum of values - (sum of values for row A))

RENJITH_R_S_0-1747402434005.png

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @RENJITH_R_S 
You can use isinscope function to manipulate the measure accorsing to hierarchie level .

Sum_ =
if (ISINSCOPE('Table'[Category]),
sum('Table'[Value]),
CALCULATE(sum('Table'[Value]),'Table'[Category]<>"A"))
Result :
Ritaf1983_0-1747422981330.png

 

The pbix with the example is attached

More information aboit isinscope here :

https://www.youtube.com/watch?v=DtOfcsS_pQw

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @RENJITH_R_S 
You can use isinscope function to manipulate the measure accorsing to hierarchie level .

Sum_ =
if (ISINSCOPE('Table'[Category]),
sum('Table'[Value]),
CALCULATE(sum('Table'[Value]),'Table'[Category]<>"A"))
Result :
Ritaf1983_0-1747422981330.png

 

The pbix with the example is attached

More information aboit isinscope here :

https://www.youtube.com/watch?v=DtOfcsS_pQw

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

@Ritaf1983 Thank you

Glad to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Alex_Sawdo
Resolver II
Resolver II

This DAX should work, however there's probably a better way you can calculate this:

Measure = 
SWITCH(
    TRUE(),
    HASONEVALUE(
        {{YOUR_TABLE}}[ROW_COLUMN]
    ),
    CALCULATE(
        SUM(
            {{YOUR_TABLE}}[VALUE_COLUMN/MEASURE]
        )
    ),
    CALCULATE(
        SUM(
            {{YOUR_TABLE}}[VALUE_COLUMN/MEASURE]
        ),
        FILTER(
            {{YOUR_TABLE}},
            {{YOUR_TABLE}}[ROW_COLUMN] <> "A"
        )
    )
)

Basically, calculate the measure normally unless there are more than one value present (the total row). If there are more values present, ignore the selected row of data (A). 

Thanks @Alex_Sawdo 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.