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
Hi,
i have a table like that:
and i want to replace the string values to numbers like that:
"Last 4 weeks" = 1
"2 months ago" = 2
"3 months ago" = 3
"4 months ago" = 4
... etc
is there a way to do the replace with this multiple values in multiple custom selected columns in one step in power query?
i only found solutions for multiple values for one column... or one value for multiple columns.
Thanks for your answers
Solved! Go to Solution.
Hi , @elaj
I'm afraid there is no way to do the replace with this multiple values in multiple custom selected columns in one step in power query.
As shown in this document, the syntax structure of function "Table.Replace.Value" does not seem to support the branch structure something like "each if .. then..".
Even if you use conditional columns, you can only operate column one by one.
Best Regards,
Community Support Team _ Eason
Hi , @elaj
I'm afraid there is no way to do the replace with this multiple values in multiple custom selected columns in one step in power query.
As shown in this document, the syntax structure of function "Table.Replace.Value" does not seem to support the branch structure something like "each if .. then..".
Even if you use conditional columns, you can only operate column one by one.
Best Regards,
Community Support Team _ Eason
Hello!
You can transform the variable (transform/ Replace values), remember that there you must take into account that the source variable is in text and you want to change it and that it is numbered (by clicking new parameter and there you select the type of variable).
I usually like to leave the original variable. To do this, I add a new conditional column (add column/conditional column).
I hope it works 🙂 for you.
Hi @elaj ,
You can do this in Power Query.
Go to the Transform Ribbon and Select Replace Value.
You can replace the values one by one.
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
@elaj - Are you trying this in Power Query, DAX or do you care?
Oh i'm sorry.. i forgot to mention. I mean in power query
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 |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 68 | |
| 31 | |
| 27 | |
| 24 |