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
Anonymous
Not applicable

How to sum up all the number in a table string

hello all,

 

I would like to ask is there any way to sum up numbers in a table string and add them into a new column.

Bruh_0-1724645807686.png

I have this table here and inside there are three column I would like to sum up the numbers from: Usage(MB), Usage(MB)_1, Usage(MB)_2. I have been struggling because I dont know if there is a way to do it in power query

1 ACCEPTED SOLUTION

Make sure you're entering the correct columns. Power Query is case-sensitive:

danextian_0-1724655999598.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @Anonymous 

Try this:

List.Sum([Table Column][Column A]) + List.Sum([Table Column][Column B])

 

[Table Column][Column A] will access a column within a table as a list. List.Sum will sum all the values in that column and will work only if the content of the column accessed are indeed numbers. If they are not numbers, the contents need to be converted to numbers first before the sum operation.

List.Sum( List.Transform( [Table Column][Column A], each try Number.From(_) otherwise null ) )

The code above tries to convert each element in the list to a number and if the conversion errors out returns null.

If a column in the table contains only one row, you can access its content with:

[Table Column][Column A]{0}
--Column A as a list then the first element of that list which is index 0

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Thank you for replying me, I followed your approach and keep getting "Expression.SyntaxError: Invalid identifier" on . Did I do sth wrong?

[Table Column][Column A]
               ^^^^^^^^

 

Make sure you're entering the correct columns. Power Query is case-sensitive:

danextian_0-1724655999598.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.