Forum Discussion
Wildcard For Year in Conditional Column
- 7 years ago
hi, Anonymous
Do you want to do these in Edit Queries?
If so, try this way as below:
Step1:
Add a custom column
=Date.Month([Date])*100+Date.Day([Date])
Step2:
Then use this custom column to add a custom quarters column
You could also use this dax formula to add a calculate column
Result = var TD=MONTH('Date'[Date])*100+DAY('Date'[Date]) return IF(TD<=316,"Q1",IF(TD<=616,"Q2",IF(TD<=1016,"Q3",IF(TD<=1231,"Q4"))))Best Regards,
Lin
hi, Anonymous
Do you want to do these in Edit Queries?
If so, try this way as below:
Step1:
Add a custom column
=Date.Month([Date])*100+Date.Day([Date])
Step2:
Then use this custom column to add a custom quarters column
You could also use this dax formula to add a calculate column
Result = var TD=MONTH('Date'[Date])*100+DAY('Date'[Date]) return
IF(TD<=316,"Q1",IF(TD<=616,"Q2",IF(TD<=1016,"Q3",IF(TD<=1231,"Q4"))))
Best Regards,
Lin
- Anonymous7 years agoNot applicable
Very creative solutions. Both work.
I also used the date functionality to create a new "Day of Year" column. I figured out which day of year each custom date I was trying to calculate and used that to create conditional column. Only issue with this one is leap years adjusts the date by one day.