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
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"Anonymous
3 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