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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PowerBI_User23
Frequent Visitor

Need Help in calculating percentage at total level in matrix

Hi All,

 

Could you please help me to calculate percantage at total level .

 

For example in below sceriao  at total level its showing 217 %  but its should be Total GP/Price %(45/210%)=21%

 

 

 

PowerBI_User23_1-1686659896126.png

 

 I have attached PBI file also 

https://drive.google.com/drive/trash 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerBI_User23 ,

Please try below steps:

1. create a measure with below dax formula

Gp Percentage =
VAR _gp =
    SELECTEDVALUE ( 'Table'[GP] )
VAR _price =
    SELECTEDVALUE ( 'Table'[Price] )
VAR sum_price =
    SUMX ( ALL ( 'Table' ), [Price] )
VAR sum_gp =
    SUMX ( ALL ( 'Table' ), [GP] )
RETURN
    IF (
        ISFILTERED ( 'Table' ),
        DIVIDE ( _gp, _price ),
        DIVIDE ( sum_gp, sum_price )
    )

2. add a matrix visual with table fields and measure

vbinbinyumsft_0-1686794650183.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

2 REPLIES 2
Anonymous
Not applicable

Hi @PowerBI_User23 ,

Please try below steps:

1. create a measure with below dax formula

Gp Percentage =
VAR _gp =
    SELECTEDVALUE ( 'Table'[GP] )
VAR _price =
    SELECTEDVALUE ( 'Table'[Price] )
VAR sum_price =
    SUMX ( ALL ( 'Table' ), [Price] )
VAR sum_gp =
    SUMX ( ALL ( 'Table' ), [GP] )
RETURN
    IF (
        ISFILTERED ( 'Table' ),
        DIVIDE ( _gp, _price ),
        DIVIDE ( sum_gp, sum_price )
    )

2. add a matrix visual with table fields and measure

vbinbinyumsft_0-1686794650183.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous   Thankyou for reply its working if there only one dimension what if i have multiple hirechy for example in below condition :

I am unable to get the at subtotal level , do i need to apply group by kind of thing , please once check this scenrio also and let me know if get the solution for this .

 

Attaching PBI file https://drive.google.com/drive/my-drive 

 

PowerBI_User23_0-1686821709513.png

 

 

 

 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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