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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Mtaberna
Frequent Visitor

split column by "|" NOT in Power Bi Query

Hi, I neet to split this column (1-PATH col)  in  n columns by a delimitator  ( | )

I know this can be easily made with power query but the column is a measure

 

LV split.PNG

 

First row result should be:

 

Column 1 INFORMESLV

Column2  CM_PATENTE

Column3  DEPRE

Column4  4227004100

 

Maximum columns = 9

Ideas ??

 

Thanks

6 REPLIES 6
Anonymous
Not applicable

Hi  @Mtaberna ,

I created some data:

vyangliumsft_0-1648524863828.png

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
VAR Temp =
    ADDCOLUMNS ( 'Table', "@Parent", SUBSTITUTE ( 'Table'[1-PATH col], "|", "|" ) )
VAR NewColumns =
    ADDCOLUMNS (
        Temp,
        "@FirstLevel", TRIM ( PATHITEM ( [@Parent], 1, TEXT ) ),
        "@SecondLevel", TRIM ( PATHITEM ( [@Parent], 2, TEXT ) ),
        "@ThirdLevel", TRIM ( PATHITEM ( [@Parent], 3, TEXT ) ),
        "@FourthLevel", TRIM ( PATHITEM ( [@Parent], 4, TEXT ) )
    )
VAR Result =
    SELECTCOLUMNS (
        NewColumns,
        "Original", [1-PATH col],
        "First Level", [@FirstLevel],
        "Second Level", [@SecondLevel],
        "Third Level", [@ThirdLevel],
        "Fourth Level", [@FourthLevel]
    )
RETURN
    Result

2. Result:

vyangliumsft_1-1648524863829.png

Best Regards,

Liu Yang

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

Hi Liu

That worked fine.. in a new table......but is there any other way to create the COLUMNS in the same Original Table  ??

The thing is......I need everything in one table

Thanks

truptis
Community Champion
Community Champion

Hi, thanks for your response.

The thing is that the proposed solutions work for just 2 columns.

I have a max of 9 columns, delimited by this character =  |

 

I need DAX code to split everything inside the column and also consider the case where 1 , 2 or more columns could be empty

 

New Ideas ?

 

Thnks

Hi Liu

That worked fine.. in a new table......but is there any other way to create the COLUMNS in the same Original Table  ??

The thing is......I need everything in one table

Thanks

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.