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 put together the following custom column in power query editor, and it generates a "Token ',' expected" error on it, and I cant actually see where I have went wrong with the code, show error highlights the first IN. Thanks if anyone has any advice to help!
SWITCH(TRUE(),
[priority_cd] IN {"A_1HRE", "B_6HRE"}
AND [class] IN {"3", "4", "8"}
AND ISNULL([need_cat], "AAA") <> "GAR"
AND [ord_status] <> "CAN"
AND ISNULL([ord_stage], "AAA") NOT IN {"CNA", "CNI", "CTR", "CWA", "DUP", "TRC"}, "Emergency",
[priority_cd] NOT IN {"A_1HRE", "B_6HRE"}
AND [class] IN {"3", "4", "8"}
AND ISNULL([need_cat], "AAA") <> "GAR"
AND [ord_status] <> "CAN"
AND ISNULL([ord_stage], "AAA") NOT IN {"CNA", "CNI", "CTR", "CWA", "DUP", "TRC"}, "NonEmergency",
[class] NOT IN {"3", "4", "8"}
OR ISNULL([need_cat], "AAA") = "GAR"
OR [ord_status] = "CAN"
OR ISNULL([ord_stage], "AAA") IN {"CNA", "CNI", "CTR", "CWA", "DUP", "TRC"}, "Other"
)
Solved! Go to Solution.
Hi,
I am not sure if PowerQuery supports SWITCH, you will need to used nested if.
Alternatively you can use Data view and write a DAX function to insert a new column; the above query should work if replace AND by && , OR by ||
Regards
Hi,
I am not sure if PowerQuery supports SWITCH, you will need to used nested if.
Alternatively you can use Data view and write a DAX function to insert a new column; the above query should work if replace AND by && , OR by ||
Regards
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 |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |