Forum Discussion
Anonymous
3 years agoNot applicable
IF Condition in Power Query using Custom Column to find MIN and MAX date
Hi I have two dates in my data (the dates are always changing) so I want to identifiy which is the MIN and which is the MAX in a NEW column I have Month 4/1/2023 5/1/2023 I want ...
Ashish_Mathur
Super User
3 years agoHi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type date}}),
Custom1 = Table.AddRankColumn(#"Changed Type","Order",{"Month", Order.Ascending},[RankKind = RankKind.Competition])
in
Custom1
Hope this helps.
Anonymous
3 years agoNot applicable
In this case is working for you because you only have 2 columns but if you have more it will give you the row number where the next value is starting
- Ashish_Mathur3 years ago
Super User
You might as well show a representative sample, explain the business context and show the expected result.