Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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:
TIME | SEASON |
01/10/2012 | 12-13 |
06/06/2014 | 13-14 |
10/03/2016 | 15-16 |
Thank you very much and best regards.
Solved! Go to Solution.
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
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
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:
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
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
97 | |
80 | |
67 | |
63 |
User | Count |
---|---|
147 | |
110 | |
108 | |
85 | |
64 |