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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

[POWER QUERY] How to change a text format

Hey everyone!

I have a challenge here in order to organize some discount code used in our orders.

There is a specific indication code, that when it used in a order, it actually shows the field like this:

ALE32H-99999

ALE32H is the actully indication code from the person that had gave the code to the person that ordered.

And 99999 is the order ID from this order.

What I need is to reduce this field to show only the indication code, so I can create a count of how many people this indication code has brought.

Since this date comes from MySQL, I thought it will be easy to transform directly in the Power Query.

What you guys think?

Does anyone know how to crack this?

FYI: the table shows like this:

LINE > Order ID, Discount Code

Thank you very much in advance

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can extract the text before the hyphen ribbon tools:

AlexisOlson_0-1637261561718.png

(Use "-" as your delimiter.)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You can extract the text before the hyphen ribbon tools:

AlexisOlson_0-1637261561718.png

(Use "-" as your delimiter.)

Anonymous
Not applicable

I'm feeling a bit newbie hahahaaha Thank you very much!!! 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.