Forum Discussion
Swalker
3 years agoFrequent Visitor
in-column replacement "error " using try otherwise and #datetime(YY,MM,DD)
Hi , I have a table with Date, FinancialPeriod (= month) and FinancialYear from entries. The accounting software uses FP and FY as key parameters Some Dates are wrongly entered : they do not match...
- 3 years ago
A few alterations should fix it:
#"step" = Table.AddColumn(#"Added Custom1", "AltDate1", each try #date([FinancialYear], [FinancialPeriod], [Day]) otherwise Date.EndOfMonth(#date([FinancialYear], [FinancialPeriod], 1)))This will put the end of the month in but you can change it if you want to stick with the (subtract 3 days) method
HotChilli
3 years agoCommunity Champion
A few alterations should fix it:
#"step" = Table.AddColumn(#"Added Custom1", "AltDate1", each try #date([FinancialYear], [FinancialPeriod], [Day])
otherwise Date.EndOfMonth(#date([FinancialYear], [FinancialPeriod], 1)))
This will put the end of the month in but you can change it if you want to stick with the (subtract 3 days) method