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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Malsha
Helper I
Helper I

Calculated column with comma delimited text split into columns in a new table

Hi,
 

I have a calculated column called 'Supervisors' in 'Table1' that is delimited by commas which I would like to split into separate columns in a new table called 'Table2'. As 'Supervisors' is a calculated column I am not able to use split column in Power Query, in any case I would like a separate table.

Any help most appreciated. Many thanks

 

Table1

Employee_ID                                   Supervisors
emp_key_00003124                        emp_key_00001002,emp_key_00002523
emp_key_00000716                        emp_key_00002523,emp_key_00003314
emp_key_00000450                        emp_key_00000155,emp_key_00002832,emp_key_00003879

Table2
Employee_ID                                   Supervisor1                        Supervisor2                        Supervisor3               
emp_key_00003124                        emp_key_00001002            emp_key_00002523
emp_key_00000716                        emp_key_00002523            emp_key_00003314
emp_key_00000450                        emp_key_00000155            emp_key_00002832           emp_key_00003879     

2 ACCEPTED SOLUTIONS

Hi @Malsha 
If I understood you correctly and you need to split the column with Dax, please refer to the linked video:
https://www.youtube.com/watch?v=j0A6CYg-BfA

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Anonymous
Not applicable

Hi @Malsha 

You can refer to the following calculated table

Table 2 =
VAR a =
    ADDCOLUMNS ( 'Table', "path", SUBSTITUTE ( [Supervisors], ",", "|" ) )
RETURN
    SUMMARIZE (
        ADDCOLUMNS (
            a,
            "Supervisor1", PATHITEM ( [path], 1 ),
            "Supervisor2", PATHITEM ( [path], 2 ),
            "Supervisor3", PATHITEM ( [path], 3 )
        ),
        [Employee_ID],
        [Supervisor1],
        [Supervisor2],
        [Supervisor3]
    )

Output

vxinruzhumsft_0-1698028887260.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Malsha 

You can refer to the following calculated table

Table 2 =
VAR a =
    ADDCOLUMNS ( 'Table', "path", SUBSTITUTE ( [Supervisors], ",", "|" ) )
RETURN
    SUMMARIZE (
        ADDCOLUMNS (
            a,
            "Supervisor1", PATHITEM ( [path], 1 ),
            "Supervisor2", PATHITEM ( [path], 2 ),
            "Supervisor3", PATHITEM ( [path], 3 )
        ),
        [Employee_ID],
        [Supervisor1],
        [Supervisor2],
        [Supervisor3]
    )

Output

vxinruzhumsft_0-1698028887260.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi v-xinruzhu-msft,
Thank you very much for your support. It's worked and gave expected output as I want. 🤗💙

Best Regards,
Malsha

Ashish_Mathur
Super User
Super User

Hi,

This cannot be done with a single DAX calculated column formula.  One will have to write one formula for each column.  The problem would be scalability (what if there are 6 commas in a cell?)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Malsha , In power query use split by delimiters, Advance options columns

 

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

 

Power Query Split Column , Split Column By Delimiter: https://youtu.be/FyO9Vmhcfag

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,
This is a calculated column. Therefore I can't use the power query editor to this. Is there any solution to do this?

Hi @Malsha 
If I understood you correctly and you need to split the column with Dax, please refer to the linked video:
https://www.youtube.com/watch?v=j0A6CYg-BfA

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi Ritaf1983,
Thank you for your support.🤗

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.