Forum Discussion
asjones
Helper V
5 years agoMax Date Math Issues In Power Query
I wrote an Excel formula that I would like to convert ot Power Querey, but I cant get the List.Max or Table.Max to work thust the rest fails also. I want a new column that works simular to this exc...
- 5 years ago
Hi asjones,
Since you need 2 columns based on the max date,I would suggest you first create a column to get the max date,using below M codes:
=Table.Max(#"Changed Type","Date")Then create another 2 columns to get 7days and 14days:
=if [Date]>Date.AddDays([Max date.Date],-7) then "7 days" else null=if [Date]>Date.AddDays([Max date.Date],-14) then "14 days" else nullAnd you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
asjones
Helper V
5 years agov-kelly-msftthanks for the reply... that is probably the cleanest option and it should also work cleanly in Excel Power Query also.
thanks
Alan
v-kelly-msft
Community Support
5 years agoHi asjones ,
Glad to help.🙂
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!