Forum Discussion
ElliotP
9 years agoPost Prodigy
Show Word if between Two Dates
Evening, I'm trying to create a column for dates which will show different categorisations depending upon the date range. The date ranges aren't within my table and I'm trying to code them into t...
- 9 years ago
Hi ElliotP,
Add a custom column with the following code:
= if [Date] >= #date(2017, 1, 1) and [Date] <= #date(2017, 7, 15) then "Term Time" else "Normal"
The M code is:
= Table.AddColumn(#"Renamed Columns", "Custom.1", each if [Date] >= #date(2017, 1, 1) and [Date] <= #date(2017, 7, 15) then "Term Time" else "Normal")
Regards,
MFelix
MFelix
9 years agoSuper User
Hi ElliotP,
Add a custom column with the following code:
= if [Date] >= #date(2017, 1, 1) and [Date] <= #date(2017, 7, 15) then "Term Time" else "Normal"
The M code is:
= Table.AddColumn(#"Renamed Columns", "Custom.1", each if [Date] >= #date(2017, 1, 1) and [Date] <= #date(2017, 7, 15) then "Term Time" else "Normal")
Regards,
MFelix
- ElliotP9 years agoPost Prodigy
Thank you so much, I greatly appreciate it.