Forum Discussion
Seasonal Date Ranges (1 Sep - 30 April every year)
Hi all,
I have a dataset that contains outcomes that occur seasonally between 1 September and 30 April (inclusive) every year since 2019 and will continue every year going forward. I am wondering if there is a way I could create a new column in my date table that would say something along the lines of:
Month | Year | Season (new column)
Aug | 2019 | Out of season
Sep | 2019 | Season 2019-20
Oct | 2019 | Season 2019-20
Nov | 2019 | Season 2019-20
Dec | 2019 | Season 2019-20
Jan | 2020 | Season 2019-20
Feb | 2020 | Season 2019-20
...
Aug | 2020 | Out of season
Sep | 2020 | Season 2020-21
Oct | 2020 | Season 2020-21
Nov | 2020 | Season 2020-21
Dec | 2020 | Season 2020-21
Jan | 2021 | Season 2020-21
Feb | 2021 | Season 2020-21
and so on...
I'm hoping there is an easy way to figure this out, I could only think of making a conditional column for every month but that would take me a while.
Thanks in advance
I think I have figured this out by creating a column with the following DAX formula
Seasonal = SWITCH(TRUE(),Dates[Date] >= DATE(2019,09,01) && Dates[Date] <= DATE(2020,04,30),"Season 19-20",Dates[Date] >= DATE(2020,09,01) && Dates[Date] <= DATE(2021,04,30),"Season 20-21",Dates[Date] >= DATE(2021,09,01) && Dates[Date] <= DATE(2022,04,30),"Season 21-22",Dates[Date] >= DATE(2022,09,01) && Dates[Date] <= DATE(2023,04,30),"Season 22-23",Dates[Date] >= DATE(2023,09,01) && Dates[Date] <= DATE(2024,04,30),"Season 23-24","Not in season")
4 Replies
- ConodonFrequent Visitor
I think I have figured this out by creating a column with the following DAX formula
Seasonal = SWITCH(TRUE(),Dates[Date] >= DATE(2019,09,01) && Dates[Date] <= DATE(2020,04,30),"Season 19-20",Dates[Date] >= DATE(2020,09,01) && Dates[Date] <= DATE(2021,04,30),"Season 20-21",Dates[Date] >= DATE(2021,09,01) && Dates[Date] <= DATE(2022,04,30),"Season 21-22",Dates[Date] >= DATE(2022,09,01) && Dates[Date] <= DATE(2023,04,30),"Season 22-23",Dates[Date] >= DATE(2023,09,01) && Dates[Date] <= DATE(2024,04,30),"Season 23-24","Not in season") - TomMartens
Super User
- ConodonFrequent Visitor
Hi Tom,
I am using the date table taken from here
https://forum.enterprisedna.co/t/extended-date-table-power-query-m-function/6390
Thanks