Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 statement or case when statement to bring that down to 4 and put the 4 new labels into a new column. I am pretty sure I need to do with in Power Query. This is what I have so far. What am I doing wrong?
"Trad Fleer Grad", each if [College]='ADULT' then 'Fleer'
else if [College]='GRAD' then 'Graduate'
else if left([College],1)='V' then 'Nondegree'
else 'Traditional')
Also, is there an "in" command, such as
if [College] in ('TRAD','5YTRD','PTTRAD') then 'Traditional'
Solved! Go to Solution.
if List.Contains({"TRAD","5YTRD","PTTRAD"},[College]) then "Traditional"
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
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.
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
if List.Contains({"TRAD","5YTRD","PTTRAD"},[College]) then "Traditional"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
15 | |
13 | |
12 | |
11 |