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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
cm008507
Frequent Visitor

Add a column that shows the percent contribution to the total of another column

I have a table visual with a cost category column with the total costs for each category.  PowerBI then provides the overall total for all of the rows.   I would like to add a column that shows the percent contribution of the overall total from each cost category.    Would I use a calculated column or measure or other?   

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @cm008507 
you can use a measure with dax "all" function.

%fromAll = SUM('Table'[value])/CALCULATE(sum('Table'[value]),all('Table'[Category]))

Ritaf1983_0-1684378283483.png

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

View solution in original post

That worked perfectly!  Thank-you Ritaf1983.

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @cm008507 
you can use a measure with dax "all" function.

%fromAll = SUM('Table'[value])/CALCULATE(sum('Table'[value]),all('Table'[Category]))

Ritaf1983_0-1684378283483.png

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

That worked perfectly!  Thank-you Ritaf1983.

It was my pleasure to assist 🙂

Syk
Super User
Super User

From what you described, you could use a measure. You could also likely just reselct your cost column and select show value as a % of grand total.

 

Syk_0-1684345007675.png

Syk_2-1684345053741.png

 

 

I was here with the same question.  Sometimes the easiest answer is right in front of your face.  Thank you!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors