Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a database with millions of records. Each record is identified by a number and text description. Therefore, I want to create a lookup by the first 3 text characters that begin with "EDT" and rename it as "External" and if it does not begin with "EDT" then call it "Internal".
Example:
ELM-HEMLOCK 1.6MI 1PH RBLD PITA1328 - This should return "Internal"
EDT: OREILLY RD BRODERICK RD 1.7MI 1PH OH RBLD WINNECONNE - This should return "External"
Thanks in advance.
Solved! Go to Solution.
No that is totally fine - we are here to help 🙂
You forgot the "if" statement !
If you don't want to code manually, have a look at the method @Vvelarde suggests above ! It uses simple dropdown lists and you are basically generating (M) code without writing it 🙂
HI @mdrammeh
I guess you want to perform this task in a calculated column?
You can use Text.Start which is the equivalent of Left function in Excel/DAX.
Create a custom column from Power Query:
if Text.Start([Pays],3) = "EDT" then "External" else "Internal"
Be careful Power Query formula language is case sensitive !
So let's say the Column with the description is titled: "Project Description". How would I rewrite this in Power Query?
if Text.Start([Pays],3) = "EDT" then "External" else "Internal"
Sorry "Pays" was just an example.
Put the name of the column which contains your codes or use @Vvelarde method suggested above 🙂
I think am missing something still. Sorry for being such a pain 🙂
No that is totally fine - we are here to help 🙂
You forgot the "if" statement !
If you don't want to code manually, have a look at the method @Vvelarde suggests above ! It uses simple dropdown lists and you are basically generating (M) code without writing it 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |