Forum Discussion
fabric-excel
1 year agoFrequent Visitor
Second Max Date based on the current Row Date
Hello, I'm current using M Language from Power Query to achieve this result (I developed already this code with DAX for Power BI and also with Excel formulas, but I need to create that logic with...
- 1 year ago
Hi fabric-excel, check this:
Output
let Source = Table.FromList({#date(2020,3,1), #date(2020,3,7), #date(2020,3,5), #date(2020,10,8), #date(2019,11,30), #date(2020,3,1)}, Splitter.SplitByNothing(), type table[Date=date]), Dates = List.Buffer(List.Sort(Source[Date])), StepBack = Source, Ad_Previous = Table.AddColumn(StepBack, "Previous", each try Dates{List.PositionOf(Dates, [Date])-1} otherwise null, type date) in Ad_Previous
v-ssriganesh
Community Support
1 year agoHi fabric-excel,
In addition to the helpful response provided by dufoq3, could you please confirm if your query have been resolved? If so, please accept it as a solution and leave a "Kudos" so other members can find it more easily.
Thank you.