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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JayTG123
Advocate I
Advocate I

Best way to separate data in one Column

Hi all,

 

I am looking for the best way to seperate the works location (screenshot below) to allow me to sum each category together. 

Split column is a possibility but I wanted to know if there is an easier way perhaps? 

 

What I am after is to calculate everything in the footway, carriageway, verge, etc. (all individually)

 

Many thanks in advance.

 

Jay

 

Power bi.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JayTG123 ,

 

You could create a new table by using DAX to split string by delimiter.

new_table = 
VAR tmp =
    ADDCOLUMNS (
        GENERATE (
            'table',
            VAR TokenCount =
                PATHLENGTH ( SUBSTITUTE ('table'[works location], ",", "|" ) )
            RETURN
                GENERATESERIES ( 1, TokenCount )
        ),
        "Split", PATHITEM ( SUBSTITUTE ( 'table'[works location], ",", "|" ), [Value] )
    )
RETURN
  SELECTCOLUMNS(tmp, "works location", [Split], "sales", 'table'[sales])

8.PNG9.PNG

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @JayTG123 ,

 

You could create a new table by using DAX to split string by delimiter.

new_table = 
VAR tmp =
    ADDCOLUMNS (
        GENERATE (
            'table',
            VAR TokenCount =
                PATHLENGTH ( SUBSTITUTE ('table'[works location], ",", "|" ) )
            RETURN
                GENERATESERIES ( 1, TokenCount )
        ),
        "Split", PATHITEM ( SUBSTITUTE ( 'table'[works location], ",", "|" ), [Value] )
    )
RETURN
  SELECTCOLUMNS(tmp, "works location", [Split], "sales", 'table'[sales])

8.PNG9.PNG

 

Best Regards,

Jay

JayTG123
Advocate I
Advocate I

Thanks @AilleryO The data will change month by month but the calculation will be the same. Just a basic sum.

Have a good split indeed lol.

Jay

AilleryO
Memorable Member
Memorable Member

Hi,

 

I think like you that the split columns on the , will be the best.

For your further analysis the question is, will it be better to split in columns or lines... ?

Depends on your data and future calculation.

If you split in lines, you might duplicate some values which could be interesting or not.

 

Have a good split 😉

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.