cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Isidro
Helper IV
Helper IV

How to calculate a season column?

Hello,

 

I would like to calculate a column in a query that reflects the season according to the date.
Each season starts on September 1 and ends on August 31.

The column should look like the following:

 

TIMESEASON
01/10/201212-13
06/06/201413-14
10/03/201615-16

 

Thank you very much and best regards.

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft
Microsoft

Hi @Isidro,

 

You could use below DAX to create a calculated column.

Season =
IF (
    'Time-Season'[TIME].[MonthNo] >= 9
        && 'Time-Season'[TIME].[MonthNo] <= 12,
    'Time-Season'[TIME].[Year] & "-"
        & 'Time-Season'[TIME].[Year] + 1,
    'Time-Season'[TIME].[Year] - 1
        & "-"
        & 'Time-Season'[TIME].[Year]
)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Microsoft
Microsoft

Hi @Isidro,

 

You could use below DAX to create a calculated column.

Season =
IF (
    'Time-Season'[TIME].[MonthNo] >= 9
        && 'Time-Season'[TIME].[MonthNo] <= 12,
    'Time-Season'[TIME].[Year] & "-"
        & 'Time-Season'[TIME].[Year] + 1,
    'Time-Season'[TIME].[Year] - 1
        & "-"
        & 'Time-Season'[TIME].[Year]
)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

If there was another column with an item and each item had a different season, how would you add that in to the DAX equation? For example: Activity Date Season Surfing 1/6/2019 2018-2019 Biking 3/7/2017 2017-2018 Sailing 8/27/2018 2018 Surfing 7/6/2018 2018-2019 Biking 9/1/2017 2017-2018 Sailing 10/4/2019 2019 And the seasons for each is: Surfing 4/1-3/31 Biking 7/1-6/30 Sailing 1/1-12/31

My previous post was unformatted. f there was another column with an item and each item had a different season, how would you add that in to the DAX equation? For example:

ActivityDateSeason
Surfing1/6/20192018-2019
Biking3/7/20172017-2018
Sailing8/27/20182018
Surfing7/6/20182018-2019
Biking9/1/20172017-2018
Sailing10/4/20192019

 

And the seasons for each is: Surfing 4/1-3/31 Biking 7/1-6/30 Sailing 1/1-12/31

Hello Yuliana,

 

Great!!! I have tried it and it works perfectly. Later I used the following formula to get the final result that I want:

 

Temporada =

                      MID(

                               'Time-Season'[Season];3;2

)

                      &"-"&

                      MID(

                               'Time-Season'[Season];8;2

)

 

Thank you very much and best regards.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors