Forum Discussion
If Statement in Power Query
- 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.⚡
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.⚡