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 ...
Anonymous
3 years agoNot applicable
PhilipTreacy
Super User
3 years agoAnonymous
You haven't put the 1 after the else
It should be
if [#"Month - Copy"] = List.Max(#"Changed Type"[#"Month - Copy"]) then 2 else 1
and this only works when the previous step is named #"Changed Type"
If you look at my example file (linked above) you'll see this works.
FYI - One of the reasons this is taking so long to solve is because you only gave us a snippet of the actual data in your original post and haven't provided any actual data to work with so we are guessing as to what yor data looks like and what steps you have in your query.
It's always best to provide a good sample of your data in a file or table - not images.
Phil