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
abhishekpati86
Helper III
Helper III

How to Sum columns in edit queries.

Hi All,

 

I have a very simple requirement to sum the below 3 score columns using custom column, can anyone please help me with that.

 

Capture.JPG

 

I am using the above code and getting an error. Is there any other way to do the same ?

 

Thanks,

AB

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @abhishekpati86,

 

I agree with ankitpatira’s point of view, you can use the insert button to add column to instead of typing column names.
For example:
 Capture.PNG

 

Capture2.PNG

 

Notice: if your columns’ type not Numeric types, you should convert it to Numeric types before above steps.

 

Capture3.PNG

 

In addition, you can also use Number.FromText function to convert the string to Numeric.


Regards,
Xiaoxin Sheng

View solution in original post

5 REPLIES 5
fra123
New Member

Hi There,

I am trying to replicate a simple Excel Step in Power Query, but getting into meny errors

Have a table wti the Following column: "P", "D", "S","N"

I want to add a new colums 

Custom= Sum( P- (D+S) - N)

I have been trying wit List.SUM but I can't find the right sysntax. Hope you can help. I am not very confident with the Query Editor

Anonymous
Not applicable

Hi @abhishekpati86,

 

I agree with ankitpatira’s point of view, you can use the insert button to add column to instead of typing column names.
For example:
 Capture.PNG

 

Capture2.PNG

 

Notice: if your columns’ type not Numeric types, you should convert it to Numeric types before above steps.

 

Capture3.PNG

 

In addition, you can also use Number.FromText function to convert the string to Numeric.


Regards,
Xiaoxin Sheng

BhaveshPatel
Community Champion
Community Champion

Hi Abhishek,

 

You can use the newly added functionality Invoke Function for this and It would be more creative solution as you can use them for other type of tasks as well.

 

To do so, 

 

1.Add a Blank query and Write the below code:

(Qscore as number, Rscore as number,Sscore as number) => Qscore + Rscore + Sscore

 

M11.PNGM10.PNGM12.PNGM13.PNG

 

 

2. Go to your original query and Under the Add Column Tab, Select Invoke Custom Function.

and Choose the appropriate options and it will give you desire results. 

 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Very nice Solution and much more sofisticated! Smiley Happy @BhaveshPatel

Jaderson Almeida
Business Coordinator
ankitpatira
Community Champion
Community Champion

@abhishekpati86 It should be simple as = [column1] + [column2]

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.