Forum Discussion
How to compare date when adding custom column
- 10 years ago
Ha - I don;t know why I didn't think of this sooner!! :)
Instead of creating a Custom Column, I tried using the "Conditional Column".
After entering the necessary values it managed to create my FinancialYear column, and I could then see the actual code in the query editor, as follows:
= Table.AddColumn(#"Changed Type6", "FinancialYear", each if [DateCaseCreated] <= #datetime(2016, 6, 30, 0, 0, 0) then "FY2016" else "FY2015" )
Woohoo!!! :)
Ha - I don;t know why I didn't think of this sooner!! :)
Instead of creating a Custom Column, I tried using the "Conditional Column".
After entering the necessary values it managed to create my FinancialYear column, and I could then see the actual code in the query editor, as follows:
= Table.AddColumn(#"Changed Type6", "FinancialYear", each if [DateCaseCreated] <= #datetime(2016, 6, 30, 0, 0, 0) then "FY2016" else "FY2015" )
Woohoo!!! :)
- satparkashm4 years agoFrequent Visitor
Was able to do with Custom Column as well using the code as
[DateCaseCreated] = #date(1900, 1, 1) then "FY2016" else "FY2015"