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
kameshm05
New Member

Power Query for split and sum the values from string

Hi,

I have a requirement to split a string and sum the values. Please find the below string as an example of my requirement. The string is a dynamic string. So we need a solution in as dynamic way.
Example:
2|xxx|3~4|xxx|5~6|xxx|7~8|xxx|9
From my example, our expected answer is 20(2+4+6+8)

I really appreciate any help you can provide.🙄

1 REPLY 1
Vijay_A_Verma
Super User
Super User

In a custom column, put following (replace Data with your column name)

List.Sum(List.Transform(Text.Split([Data],"~"), (x)=>Number.From(Text.BeforeDelimiter(x,"|"))))

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.