Forum Discussion
IF Condition in Power Query using Custom Column to find MIN and MAX date
Hi Anonymous
You could use this
= if [Month] = List.Max(#"Changed Type"[Month]) then 2 else 1
where this step is referencing the [Month] column in the previous step, which in this case is called #"Changed Type". In your case it may well be called soemthign else, you'll need to change it accordingly.
Regards
Phil
Hi I still have the problem
- Anonymous3 years agoNot applicable
- PhilipTreacy3 years agoSuper User
Anonymous
You haven't put the 1 after the else
It should be
if [#"Month - Copy"] = List.Max(#"Changed Type"[#"Month - Copy"]) then 2 else 1and 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
- Anonymous3 years agoNot applicable