PowerBi Conditional Column Between 2 Dates

Viewed 36

My First PowerBi Question on here.

Im trying to insert a Conditional Column in the Power Query Editor where if a date falls between Certain dates, a specific Value is added. The dates and values are listed below.

I have attached a screenshot of my attempt but the results stop at 51 and do no increase from there.

can you please confirm where i am going wrong with this? its almost as if it needs a Between arguement but not sure if this is possible in the Power Query Editor?

Dates & Values:

Before 18/07/2022 = 31

On or After 18/07/2022 & Before 08/08/2022 = 51

On or After 08/08/2022 & Before 30/08/2022 = 71

On or After 30/08/2022 = 91

enter image description here

1 Answers

If statement searchs for the first TRUE() value and return it. In your case you use condition "after or equal" so every date with value >=18/07/2022 gets 51, because it is the first True value.

Try to change the order:

  1. is before 18/07/2022 = 31
  2. after or equal to 30/08/2022 = 91
  3. after or equal to 08/08/2022 = 71
  4. after or equal to 18/07/2022 = 51
Related