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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
rajasekar_o
Helper V
Helper V

hierarchy level contribution

hi team, How to calculate  hierarchy level contribution

rajasekar_o_0-1712660357484.png

expected output


office group sales is 33774 - 63.97%

                            ink -25.79%

                            note- 31.23%

                            pen - 42.97%

school group sales is 19020- 36.03%

                            ink -3.31%

                            note- 94.04%

                            pen - 2.65 %

Total Sales is 52794 - 100%

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rajasekar_o ,

I create a table as you mentioned.

vyilongmsft_0-1712715836014.png

Then I use it in the Matrix visual.

vyilongmsft_1-1712715936310.png

I create a measure and here is the DAX code.

Measure =
IF (
    HASONEVALUE ( 'Table'[AMOUNT] ),
    MAX ( 'Table'[Column] ),
    SUM ( 'Table'[AMOUNT] ) / CALCULATE ( SUM ( 'Table'[AMOUNT] ), ALL ( 'Table' ) )
)

Finally I get what you want.

vyilongmsft_2-1712716375045.png

 

 

 

Best Regards

Yilong Zhou

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @rajasekar_o ,

I create a table as you mentioned.

vyilongmsft_0-1712715836014.png

Then I use it in the Matrix visual.

vyilongmsft_1-1712715936310.png

I create a measure and here is the DAX code.

Measure =
IF (
    HASONEVALUE ( 'Table'[AMOUNT] ),
    MAX ( 'Table'[Column] ),
    SUM ( 'Table'[AMOUNT] ) / CALCULATE ( SUM ( 'Table'[AMOUNT] ), ALL ( 'Table' ) )
)

Finally I get what you want.

vyilongmsft_2-1712716375045.png

 

 

 

Best Regards

Yilong Zhou

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.