Forum Discussion
gonrodrigues
10 years agoHelper III
Custom Column Homologous Month
Hello, To create colum Current Month I used this: Table.AddColumn(MonthName, "CurrentMonth", each Date.IsInCurrentMonth( [Date] )) and if I want to creat two more: "HomologousMonth" and "Pre...
- 10 years ago
- 10 years ago
You can get the HomologousMonth with Date.IsInCurrentMonth as well. Just add one year to [Date] and predicate it with IsInCurrentMonth.
Table.AddColumn(PreviousMonth, "HomologousMonth", each Date.IsInCurrentMonth( Date.AddYears([Date],1) ))
If you have any question, feel free to let me know.
Eric_Zhang
10 years agoMicrosoft Employee
gonrodrigues
10 years agoHelper III
Is necessary to integrate with this expression:
Table.AddColumn(PreviousMonth, "MonthSlicer", each if [CurrentMonth] then "Current Month" else if [PreviousMonth] then "Previous Month" else [Month])
I already have current Month:
Table.AddColumn(MonthName, "CurrentMonth", each Date.IsInCurrentMonth( [Date] ))
and Previous Month:
Table.AddColumn(CurrentMonth, "PreviousMonth", each Date.IsInPreviousMonth( [Date] ))
I don't know if it was strictly necessary but i did it this way.
Thanks Eric_Zhang
- Eric_Zhang10 years agoMicrosoft Employee
You can get the HomologousMonth with Date.IsInCurrentMonth as well. Just add one year to [Date] and predicate it with IsInCurrentMonth.
Table.AddColumn(PreviousMonth, "HomologousMonth", each Date.IsInCurrentMonth( Date.AddYears([Date],1) ))
If you have any question, feel free to let me know.- gonrodrigues10 years agoHelper III
Worked perfectly. Thanks a lot!