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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Bansi008
Helper III
Helper III

How to do percentage calculation in the Power BI

Hi guys – I have a sample table like below in Power BI editor query. I need to calculate market value % using the values below. In excel we usually calculate value1/ SUM(column value), Value2/SUM(column value) and so on. How we can calculate the thing in the powerBI? I want add extra column for this calculation.

 

Market Value

123456

1234567

1236547

136547896

1478523699

1236547

 

 

 

3 REPLIES 3
jennratten
Super User
Super User

You can find each row's percent of the total like this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNjE1U4rVgTHNYWwzUxMoG8y0sISqAjJNgbKWlqgKYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Market Value" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Market Value", Int64.Type}}),
    #"Inserted Percent Of" = Table.AddColumn(#"Changed Type", "Percent Of", let varTotal = List.Sum ( #"Changed Type"[Market Value] ) in each [Market Value] / varTotal * 100, type number)
in
    #"Inserted Percent Of"

 

jennratten_0-1680538073372.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Thanks for the response. but i am not sure how to apply this solution since PowerBI tool is very much new for me. Can you please guide me how i can implement this solution in the tool. I have populated data connecting to Oraclt database and column as below. 

Bansi008_0-1680597397036.png

 

 

Sure thing - click the last step in your query settings, then click the function button in the formula bar.  The name of the prior step will appear in the formula bar.  Paste this into the formula bar and replace #"Changed Type" with your previous step.

= Table.AddColumn(#"Changed Type", "Percent Of", let varTotal = List.Sum ( #"Changed Type"[Market Value] ) in each [Market Value] / varTotal * 100, type number)

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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