Forum Discussion
case when or if with strings in Power Query
- 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
Hi Anonymous ,
I understand that in SQL, you should be using ' '.
But in Power Query, it should be " ".
if
[College] = "ADULT"
then "Fleer"
else
if [College] = "GRAD"
then "Graduate"
else
if
Text.Start( [College], 1) = "V"
then "Nondegree"
else
"Traditional"
-----------
if
List.Contains( {"TRAD","5YTRD","PTTRAD"}, [College] )
then "Traditional"
else
YourConditon
Hope this helps