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.
Hello,
In order to add a new conditionnal column from my request, I have written a formula using M language.
I feel everything is ok and it should run well, but I have a "Jeeton Literal" waited error.
The end of my formula is a little bit tricky as I would like to write "balance" when A and B doesn't start the same way.
= Table.AddColumn(#"Colonnes renommées1", "ABCDEF", each if ([A] = "1") then "Capitale" or if ([B] = "1") then "Capitale" else if (Text.StartsWith([A], "jj")) then "INTER" and if (Text.StartsWith([B], "jj")) then "INTER" else if (Text.StartsWith([A], "kk")) then "DOM" and if (Text.StartsWith([B], "kk")) then "DOM" else if ([A] <> [B]) then "balance" else null )
Maybe this isn't the good place to post this, but I may need a little help.
Thanks and good evening,
Jj
Solved! Go to Solution.
You're nesting weird extra ifs into and/or conditions. Your column's function should read
if [A] = "1" or [B] = "1" then "Capitale" else if Text.StartsWith([A], "jj") and Text.StartsWith([B], "jj") then "INTER" else if Text.StartsWith([A], "kk") and Text.StartsWith([B], "kk") then "DOM" else if [A] <> [B] then "balance" else null
Proud to be a Super User!
You're nesting weird extra ifs into and/or conditions. Your column's function should read
if [A] = "1" or [B] = "1" then "Capitale" else if Text.StartsWith([A], "jj") and Text.StartsWith([B], "jj") then "INTER" else if Text.StartsWith([A], "kk") and Text.StartsWith([B], "kk") then "DOM" else if [A] <> [B] then "balance" else null
Proud to be a Super User!
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |