I am pulling in a table from the web with only the day and month. Power query is guessing the date and setting everything to 2023. Is there a way to tell it to change to 2022 if the date is greater than today's date?
Would be very helpful if you attached (uploaded) a sample file with 8-10 records showing what your file looks like when it has been downloaded from the Web.
I created a small example in the attached file, where the following code adds a column with corrected dates for dates after today.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Corrected Date", each if Date.IsInYearToDate([Date]) then [Date] else Date.AddYears ([Date], -1))
in
#"Added Custom"