Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to add a column in the query editor by using an if-then statement based on the left x characters of one of the other columns in my table. When I use a nested if statement in the table itself and add the custom field, this seems to work using yet this does not seem to work when adding a custom column in the query editor environment. Here's what I've tried:
if left(column,5)="abcde" then "a" else "b"
I realise I could work with adding the column outside the query editor, but I'd like to understand how to use the function inside it as well.
thanks
Solved! Go to Solution.
@Anonymous Functions in DAX and M-Language (Power Query) are different.
You need to use as below in Power Query Editor as custom column
if Text.Start(column,5) = "abcde" then "a" else "b"
if Text.End(column,2) = "de" then "d" else "e"
Proud to be a PBI Community Champion
@Anonymous Functions in DAX and M-Language (Power Query) are different.
You need to use as below in Power Query Editor as custom column
if Text.Start(column,5) = "abcde" then "a" else "b"
if Text.End(column,2) = "de" then "d" else "e"
Proud to be a PBI Community Champion
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |