Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

If Statement in Power Query

Hey guys,    I have succesfully built this logic in DAX, but I need to create it in the power query.  Could you help me with that?   If(Enrollment date>=Date(2019,01,01) && Enrollment date<=date(...
  • parry2k's avatar
    6 years ago

    Anonymous here is PQ version

     

    If [Enrollment date]>=#date(2019,01,01) and [Enrollment date]<=#date(2019,12,31) and [Program]="New" then  "2019" else
    if [Enrollment date]>=#date(2020,01,01) and [Enrollment date]<=#date(2020,12,31) and
    [Program]= "Old" then "2020"  else "Other"
    
     

     

    make sure column names are correct as per your table.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.