Forum Discussion
Anonymous
3 years agoNot applicable
case when or if with strings in Power Query
I am new to Power BI but have used SQL. Both M and DAX are making me feel stupid!! Thanks for letting me vent. I have a column that groups students into 8 different types. I want to use an if sta...
- 3 years ago
if List.Contains({"TRAD","5YTRD","PTTRAD"},[College]) then "Traditional"
- 3 years ago
Hi Anonymous ,
I understand that in SQL, you should be using ' '.
But in Power Query, it should be " ".
if
[College] = "ADULT"
then "Fleer"
elseif [College] = "GRAD"
then "Graduate"
elseif
Text.Start( [College], 1) = "V"
then "Nondegree"
else"Traditional"
-----------
if
List.Contains( {"TRAD","5YTRD","PTTRAD"}, [College] )
then "Traditional"
else
YourConditon
Hope this helps
Anonymous
3 years agoNot applicable
Thank you both. I asked one question and learned a lot: about the spaces, " instead of ', List.Contains, Text.Start, and those { }. I am on a roll.