Forum Discussion
Benji_964
6 years agoNew Member
Adding a seasons column to dates table based on month dates
Hi everyone, I'm relatively new to PowerBI but thanks to this site my first reports are already working great. Unfortunatly I couldn`t find any solution for this minor problem... I'm generat...
- Anonymous6 years ago
HI Benji_964 ,
Try and create a Calculated Column.
Season Year = VAR _season = IF ( MONTH ( 'Dates'[Dates] ) <= 7, VALUE ( FORMAT ( 'Dates'[Dates], "YYYY" ) ), VALUE ( FORMAT ( 'Dates'[Dates], "YYYY" ) ) - 1 ) RETURN CONCATENATE ( "SEASON", CONCATENATE ( _season, CONCATENATE ( "/", _season + 1 ) ) )Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Anonymous
6 years agoNot applicable
HI Benji_964 ,
Try and create a Calculated Column.
Season Year =
VAR _season =
IF (
MONTH ( 'Dates'[Dates] ) <= 7,
VALUE ( FORMAT ( 'Dates'[Dates], "YYYY" ) ),
VALUE ( FORMAT ( 'Dates'[Dates], "YYYY" ) ) - 1
)
RETURN
CONCATENATE ( "SEASON", CONCATENATE ( _season, CONCATENATE ( "/", _season + 1 ) ) )
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- Benji_9646 years agoNew Member
Hi Anonymous,
thank you for your help and the fast reply.
Your solution workes grate!
Had to make only some minor changes.
"<=6" instead of "<=7" and put the "-1" after the first instead of the second value.
Here my solution:
Brennjahr = VAR _season = IF ( MONTH ( 'Datumstabelle'[Date] ) <= 6, VALUE ( FORMAT ( 'Datumstabelle'[Date], "YYYY" ) ) -1, VALUE ( FORMAT ( 'Datumstabelle'[Date], "YYYY" ) ) ) RETURN CONCATENATE ( _season, CONCATENATE ( "-", _season + 1 ) )Thank you very much!