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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Marshmallow
Helper II
Helper II

Calculating percentage total and grand total for Matrix table

I am trying to build a matrix table that will show the value as well as the percentage. I have included screenshot below. I am stuck with the grand total percentage as it now shows the grand total of each row instead of 100%.

 

This is the data source:

Marshmallow_1-1701051896054.png

 

 

I am building the table to show it as is in the matrix format but i am unable to get the column D (state share portion) right. It either will show Grand total as 500% or it will calculate percentage by row to make the grand total of 100%.

 

Can someone please help?  

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_2-1701062261452.png

 

 

Jihwan_Kim_1-1701062148655.png

 

State share percentage: =
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Product'[Product] ),
        DIVIDE (
            [Total Quantity:],
            CALCULATE ( [Total Quantity:], ALL ( 'Product'[Product] ) )
        ),
    ISINSCOPE ( State[State] ),
        DIVIDE (
            [Total Quantity:],
            CALCULATE (
                [Total Quantity:],
                ALL ( 'Product'[Product] ),
                ALL ( State[State] )
            )
        ),
    DIVIDE (
        [Total Quantity:],
        CALCULATE (
            [Total Quantity:],
            ALL ( 'Product'[Product] ),
            ALL ( State[State] )
        )
    )
)

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

2 REPLIES 2
Marshmallow
Helper II
Helper II

Thank you, it works! 🙂

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_2-1701062261452.png

 

 

Jihwan_Kim_1-1701062148655.png

 

State share percentage: =
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Product'[Product] ),
        DIVIDE (
            [Total Quantity:],
            CALCULATE ( [Total Quantity:], ALL ( 'Product'[Product] ) )
        ),
    ISINSCOPE ( State[State] ),
        DIVIDE (
            [Total Quantity:],
            CALCULATE (
                [Total Quantity:],
                ALL ( 'Product'[Product] ),
                ALL ( State[State] )
            )
        ),
    DIVIDE (
        [Total Quantity:],
        CALCULATE (
            [Total Quantity:],
            ALL ( 'Product'[Product] ),
            ALL ( State[State] )
        )
    )
)

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.