Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need to create a new column with date range

Hello, I am looking for help on how to generate a new column in my data anf the data range is between 11/30/2021 and 2/14/2022 to put the work Peak if it's between those data and Non Peak if it is no...
  • parry2k's avatar
    3 years ago

    Anonymous you are adding this in PQ, my solution was adding a column by DAX. if you want a PQ solution then do the following M code:

     

     

    if [Date] >= #date(2021,11,30) and [Date] <= #date(2022,2,14) then "Peak" else "No Peak"

     

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to 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.