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
Spotto
Helper IV
Helper IV

Separate two or more codes on the same line into two or more lines

Hi everyone, I need some help.
I have a table in excel that has a column (VOUCHER) where there are two codes separated by (-), I would like to know how to do it in power query to separate the VOUCHER into two or more lines and repeat the other information from the other columns

 

Example 1)

CODETIPEVOUCHER
287865 X11955734 - 1955745

 

RESULT

CODETIPEVOUCHER
287865 X11955734
287865 X11955745

 

Example 2)

CODETIPEVOUCHER
123456 X11955734 - 1955745 - 1957865

 

RESULT

CODETIPEVOUCHER
123456 X11955734
123456 X11955745
123456 X11957865

 

tks for helpe me 🙂

2 ACCEPTED SOLUTIONS
Luis98
Resolver II
Resolver II

Hi @Spotto 

 

You can split your column in rows with the advanced options of split column:

Luis98_0-1669329225505.png

and you get what you want exactly

 

View solution in original post

v-yalanwu-msft
Community Support
Community Support

Hi, @Spotto ;

You could split the column by "-".

vyalanwumsft_0-1669340877948.png

Then unpivot those columns.

vyalanwumsft_1-1669340922398.png

The final show:

vyalanwumsft_2-1669340975561.png


Best Regards,
Community Support Team _ Yalan Wu
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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Spotto ;

You could split the column by "-".

vyalanwumsft_0-1669340877948.png

Then unpivot those columns.

vyalanwumsft_1-1669340922398.png

The final show:

vyalanwumsft_2-1669340975561.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Luis98
Resolver II
Resolver II

Hi @Spotto 

 

You can split your column in rows with the advanced options of split column:

Luis98_0-1669329225505.png

and you get what you want exactly

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.