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

Calculate sum of column in query editor

I have the following table in the query editor of PowerBI.

I would like to either :

- Calculate the sum of "Nombre de répondants" and add it in a new column (it would be the same value for every line) or

- Calculate the proportion of "Nombre de répondants"

 

As a result, I would have one of the two new columns in the second image. (My 249 will varie in the future)

I would prefer doing it in the query editor.

 

Thank you!

 

Actual Table :

 

Actual table - v2.png

 

Wanted table :

 

wanted table - v2.png

 

 

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

@KaterineCAA

 

To achieve your requirement, you can refer to following steps:

 

  1. In Edit Queries, go to Add Column and add a Custom Column.
  2. Use Power Query expression like: List.Sum(#"Changed Type"[Nombre de répondants]) to get the sum of Nombre de répondants.
  3. Then for Proportion, you can simply use expression like: [Nombre de répondants]/[ Nombre de répondants Total]

 

Thanks,
Xi Jin.

View solution in original post

3 REPLIES 3
v-xjiin-msft
Solution Sage
Solution Sage

@KaterineCAA

 

To achieve your requirement, you can refer to following steps:

 

  1. In Edit Queries, go to Add Column and add a Custom Column.
  2. Use Power Query expression like: List.Sum(#"Changed Type"[Nombre de répondants]) to get the sum of Nombre de répondants.
  3. Then for Proportion, you can simply use expression like: [Nombre de répondants]/[ Nombre de répondants Total]

 

Thanks,
Xi Jin.

Hi, is this solution still current, i cannot get it to work

Thank you so much!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors