# Power Query: % of total

#### Lance Pretorius

##### New Member
In Power Query how do you add a custom column that displays row total as % of column total?
See Below

 Index Name Total Column to be added Column to be added formula 1 A 100 4.76%​ =\$D4/SUM(\$D\$4:\$D\$9) 2 B 200 9.52%​ 3 A 300 14.29%​ 4 B 400 19.05%​ 5 A 500 23.81%​ 6 B 600 28.57%​

#### GraH - Guido

##### Well-Known Member
If your table would be in Excel

Code:
``````let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Index", Int64.Type}, {"Name", type text}, {"Total", Int64.Type}}),
#"Inserted Percent Of" = Table.AddColumn(#"Added Custom", "Percent Of", each [Total] / [Custom] * 100, type number)
in
#"Inserted Percent Of"``````
Note the step Percent Of is doable via the ribbon:
Select column total then column custom then apply as in screenshot #### Attachments

• 17.7 KB Views: 10
• Thomas Kuriakose

#### Chihiro

##### Excel Ninja
This sort of calculation is best done in DAX. It's more efficient.

However, there are many ways to do this. Using GUI as GraH showed above for one.

Using calculated column like below.
Code:
``=[Total]/List.Sum(Source[Total])``

• Thomas Kuriakose

#### Lance Pretorius

##### New Member
It worked,
Thank you for Helping