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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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

Click here to schedule a short Teams meeting to discuss your question.

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

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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