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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Karolina411
Helper V
Helper V

Can I actually add 2-4 numbers that are coded to one column by splitting the column?

Hello Super Dax Greatness:

Due to some hectic permutations of productivity Matrix SQL I get a column with 

1, 2, 3 and sometimes 4 entries related to 1 encounter.  I wish to sum them--can I do that using DAX somehow and splitting the column by the | as shown below?

Thanks!

Karolina411_0-1677713188101.png

 

1 ACCEPTED SOLUTION
bolfri
Solution Sage
Solution Sage

In the Power Query M editor add custom column:

 

List.Sum(
    List.Transform(
        Text.Split([C_time], "|"), 
        each Number.FromText(_)
        )
    )

 

 

bolfri_0-1677800508081.png



It will work for any splitter it founds (see last row)

bolfri_1-1677800578489.png

 





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
bolfri
Solution Sage
Solution Sage

In the Power Query M editor add custom column:

 

List.Sum(
    List.Transform(
        Text.Split([C_time], "|"), 
        each Number.FromText(_)
        )
    )

 

 

bolfri_0-1677800508081.png



It will work for any splitter it founds (see last row)

bolfri_1-1677800578489.png

 





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

Proud to be a Super User!




Karolina411
Helper V
Helper V

I tried to split on the | --I could not somehow--then I would simply sum the two columns---

Ahmedx
Super User
Super User

or do you need it?
Screen Capture #394.png

Ahmedx
Super User
Super User

Is this what you are looking for?
Screen Capture #393.png

Yes--indeed--to sum them together---It's a complex issue and I had to use the WITHIN GROUP SQL function to make it work.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.