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

merging with semi colon and add totals

Hi I have a data set from sql - i need to create a graphic that combines and makes a total 

 

currently the cell has multiple numbers seperated with a ; e.g - 1000; 100; 200

 

i need a new column that combines these values to be 1300.

 

thanks

1 ACCEPTED SOLUTION

That seems odd to me since this is supposed to be a Power Query forum.

But to do this in DAX, something like the below seems to work.

 

Sum = 
   VAR _path = SUBSTITUTE([Column1],";","|")
   VAR _count = PATHLENGTH(_path)
   VAR _series = GENERATESERIES(1,_count,1)
   var mytable = 
        ADDCOLUMNS(
            _series,
            "mySum", VALUE(PATHITEM(_path,[Value])))
RETURN 
    SUMX(mytable,VALUE([mySum]))

 

ronrsnfld_1-1722894759090.png

 

 

View solution in original post

5 REPLIES 5
Archiedog1
New Member

how do i do this is power bi?

Cannot help now as I am not at my computer. But in the future, I would suggest you pose that kind of question in the dax section rather than the power query section

i did and they told me to post here

 

That seems odd to me since this is supposed to be a Power Query forum.

But to do this in DAX, something like the below seems to work.

 

Sum = 
   VAR _path = SUBSTITUTE([Column1],";","|")
   VAR _count = PATHLENGTH(_path)
   VAR _series = GENERATESERIES(1,_count,1)
   var mytable = 
        ADDCOLUMNS(
            _series,
            "mySum", VALUE(PATHITEM(_path,[Value])))
RETURN 
    SUMX(mytable,VALUE([mySum]))

 

ronrsnfld_1-1722894759090.png

 

 

ronrsnfld
Super User
Super User

Split and sum:

   #"Sum Column1" = Table.AddColumn(Source, "Sum Col 1", (r)=> 
        List.Sum(
            List.Transform(
                Text.Split(r[Column1],";"),
            each Number.From(_))), 
        Int64.Type)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors