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
Source = #table(type table [Month=date, Order=Int64.Type], {{#date(2023,4,1),1},{#date(2023,5,1),2}})
in
Source- Anonymous3 years agoNot applicable
In this case month will be dynamic it won't always be those months
- Ahmedx3 years agoSuper User
what do you mean dynamic? current month and previous month?
let YearNow = Date.Year( DateTime.LocalNow()), MonthNow = Date.Month( DateTime.LocalNow()), startdate =#date(YearNow,MonthNow-1,1) , EndDate = #date(YearNow,MonthNow,1) , Source = #table(type table [Month=date, Order=Int64.Type], { {startdate,1},{EndDate,2}}) in Source- Anonymous3 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