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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculate percentage from same column

Hello,

 

I was wondering if there is a way to calculate the percentage of a value in a column based on a different value in the same column. To do this I'd like to use a different column as an index.

For instance, on the attached picture, I would like to calculate the percentage of Total Labor on Total Cost.

 

Thanks for your time.

Capture8321412.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello @Anonymous

 

Try this please:

 

Percentage= DIVIDE(CALCULATE(SUM(Table[Month Budget]);FILTER(Table;Table[Category]="Total Labor"));CALCULATE(SUM(Table[Month Budget]);FILTER(Table;Table[Category]="Total Cost")))

 

I hope this works.

 

PS, in "Table", you've to put the name of the table.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello @Anonymous

 

Try this please:

 

Percentage= DIVIDE(CALCULATE(SUM(Table[Month Budget]);FILTER(Table;Table[Category]="Total Labor"));CALCULATE(SUM(Table[Month Budget]);FILTER(Table;Table[Category]="Total Cost")))

 

I hope this works.

 

PS, in "Table", you've to put the name of the table.

Anonymous
Not applicable

Sorry, I didn't fully explain my situation. I have dozens of clients and every client has those 5 rows with a client ID. Your solution, while elegant, it will only work if there was only one set if clients.

 

I ended up splitting the table into 5 smaller tables each containing one category and then doing calculations that way. I know it's not clean.

Hi @Anonymous

 

It seems you may use "Append Queries" in query editor to combine the tables. Then you may use the measure as HarrisonCbe mentioned. If it is not your case, please share sample data for your scenario so that we could help further on it.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.