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
Anonymous
Not applicable

How to calculate percentage of subtotals?

Dear All,

 

For a table with this layout (as mentioned below) I would like to calculate the percentage based on the subtotal. 

 

Power_BI_Adapt_1-1651757928736.png

 

In this example:

 

Subtotal of first company is 7288, with a break down to 2775 and 4514

 

Subtotal of second company is 4809, with a break down to 3431 and 1378

 

I want to come to the following percentages:

 

First company:

* Subtotal:  100%

* Eerder dan 13.00 uur: 38%

* Later dan 13.00 uur: 62%

 

Second company: 

 

* Subtotal:  100%

* Eerder dan 13.00 uur: 71%

* Later dan 13.00 uur: 29%

 

A DAX or any oher solution will be helpful, to create a separate column with a percentage.

 

Kind regards

 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below, and I hope the below measure can help to modify and apply it to your data model.

 

Slide1.jpg

 

SubCat ratio: =
IF (
    ISINSCOPE ( SubCategory[Category] ),
    DIVIDE (
        Data[Total value:],
        CALCULATE ( Data[Total value:], ALLEXCEPT ( Data, SubCategory[Category] ) )
    )
)

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

v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? 

If your values in the matrix are columns, you still need a SUM function:

Percentage =
DIVIDE (
    'Table'[Value],
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Company] ) )
)

vkalyjmsft_0-1652249538212.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? 

If your values in the matrix are columns, you still need a SUM function:

Percentage =
DIVIDE (
    'Table'[Value],
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Company] ) )
)

vkalyjmsft_0-1652249538212.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below, and I hope the below measure can help to modify and apply it to your data model.

 

Slide1.jpg

 

SubCat ratio: =
IF (
    ISINSCOPE ( SubCategory[Category] ),
    DIVIDE (
        Data[Total value:],
        CALCULATE ( Data[Total value:], ALLEXCEPT ( Data, SubCategory[Category] ) )
    )
)

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.

This looks like it's exactly the solution I've been looking for, for several days. Thanks so much for providing the file. I intend to try modifying the code for my needs shortly.

Super it worked, kudos to you, thanks.

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.