Forum Discussion
Anonymous
3 years agoNot applicable
Max and Min date
Hi, I am trying to create identify with 1 and 2 the Max and Min date (1=Min and 2=Max). Table2: Month Order April 2023 1 May 2023 2 Preferly in Power Query
Anonymous
3 years agoNot applicable
This month JUNE 2023 it has APRIL 2023 and MAY 2023, next month
JULY 2023 it will have MAY 2023 and JUNE 2023, next month
AUGUST 2923 it will have JUNE 2023 and JULY 2023...
It will be always changing
Ahmedx
3 years agoSuper User
pls try this
let
DateNow = List.Transform( List.Generate(()=> Date.AddMonths( Date.From( DateTime.LocalNow()),-2),
(x) => x <= Date.From( DateTime.LocalNow()),
(x) => Date.AddMonths(x,1)), (x) => Date.StartOfMonth(x)),
#"Converted to Table" = Table.FromList(DateNow, Splitter.SplitByNothing(), {"Month"}, null, ExtraValues.Error),
#"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Order", 1, 1, Int64.Type)
in
#"Added Index"- Anonymous3 years agoNot applicable
It didn't worked I added it in the advanced editor, maybe by doing step by step?
- Ahmedx3 years agoSuper User
Sample PBIX file attached