Forum Discussion
Anonymous
4 years agoNot applicable
Creating a column converting months to seasons
Hi there. I have a table "Dates" that looks like below. I would like to create a seasons column (in red) but unsure of the dax. Nov, Dec, Jan = Winter Feb, March, April = Spring May, Ju...
- 4 years ago
Anonymous Well, you could always do a SWITCH statement:
Season Column = SWITCH([StartMonth], "November","Winter", "December","Winter", "January","Winter", "February","Spring", "March","Spring", "April","Spring", "May","Summer", "June","Summer", "July","Summer", "Autumn" ) - 4 years ago
Anonymous
Another version of Switch can be this one:
New Column = SWITCH( TRUE(), 'Table'StartMonth = "December" || 'Table'StartMonth = "January" || 'Table'StartMonth = "February", "Winter", 'Table'StartMonth = "March" || 'Table'StartMonth = "April" || 'Table'StartMonth = "May", "Spring", 'Table'StartMonth = "June" || 'Table'StartMonth = "JUly" || 'Table'StartMonth = "August", "Summer", 'Table'StartMonth = "September" || 'Table'StartMonth = "October" || 'Table'StartMonth = "November", "Autumn", BLANK() )
Anonymous
4 years agoNot applicable
Thank you both Greg_Deckler and themistoklis - both worked and I've learned something new!! Only new to powerbi so just learning as I go.