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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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.