Forum Discussion
Max Date Math Issues In Power Query
- 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!
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 null
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
v-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-msft5 years ago
Community Support
Hi asjones ,
Glad to help.🙂
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!