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
larx_mandel
Frequent Visitor

Get % for a group in Power BI table matrix

Hi,

I am new to Power BI. I need to build a DAX measure to sum a variable by group, and to get percentage inside each group.

For example:

 

| Nr | Name | Vendor Name   | Quantity |     %     | Sum  |
| 1   | Name1 | Vendor1          | 694        | 48.16% | 1441 |
| 1   | Name1 | Vendor2          | 397        | 27.55% | 1441 |
| 1   | Name1 | Vendor3          | 350        | 24.29% | 1441 |
| 2   | Name2 | Vendor4          | 450        | 100%    | 450   |

 

I tried the following measure to get the sum by group, but the sum is not correct.

 

Total Quantity by Nr =
CALCULATE(
SUM('Table'[Quantity]),
ALLEXCEPT('Table', 'Table'[Nr])
)

Thanks for the help.

1 ACCEPTED SOLUTION
hackcrr
Super User
Super User

Hi, @larx_mandel 

I created a measure using these two DAX expressions:

Total Quantity by Nr = 
CALCULATE(
    SUM('Table'[Quantity]),
    ALLEXCEPT('Table', 'Table'[Nr])
)
Percentage by Nr = 
DIVIDE(
    SUM('Table'[Quantity]),
    [Total Quantity by Nr],
    0
)

hackcrr_0-1724712121404.png

hackcrr_1-1724712137213.png

I have uploaded the PBIX file of this example below for your reference.

 

 

If I have answered your question, please mark my reply as solution and kudos to this post, thank you!

View solution in original post

1 REPLY 1
hackcrr
Super User
Super User

Hi, @larx_mandel 

I created a measure using these two DAX expressions:

Total Quantity by Nr = 
CALCULATE(
    SUM('Table'[Quantity]),
    ALLEXCEPT('Table', 'Table'[Nr])
)
Percentage by Nr = 
DIVIDE(
    SUM('Table'[Quantity]),
    [Total Quantity by Nr],
    0
)

hackcrr_0-1724712121404.png

hackcrr_1-1724712137213.png

I have uploaded the PBIX file of this example below for your reference.

 

 

If I have answered your question, please mark my reply as solution and kudos to this post, thank you!

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.