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
Ashish_Mathur
3 years agoSuper User
Hi,
What if there are 12 rows (one for each month)? What should the result be?
- Ahmedx3 years agoSuper User
in that case you can do this:
let Source = List.Generate( ()=> #date(2023,1,1), (x) => x<= #date(2023,12,1), (x)=> Date.AddMonths(x,1) ), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Month"}, null, ExtraValues.Error), #"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Order", 1, 1, Int64.Type) in #"Added Index"