Ytd calendar table

Melissa is it possible to add YTD for all the years in the calendar table ,
So all less then 07 jan per year is true else false

@WimH ,

I think the ISAFTERTODAY function in @Melissa’s date table will handle this well.

  • Brian

Brian, what i need is that all the dates before ( for example ) 7 jan. in the years ( 2018,2019,2020,2021,2022 ) are True and dates after are false.

Hi @WimH. Is this what you’re looking for?

If so, a quick-and-dirty way is to add 2 custom columns to the [Dates] table, say [Today] and [Before Today Every Year]

let
    Source = #"Extended Date Table"(fxStartDate, fxEndDate, 7, null, null),
    #"Added Custom" = Table.AddColumn(Source, "Today", each Date.From(DateTime.LocalNow())),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Today", type date}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type", "Before Today Every Year", each if [MonthOfYear] <= Date.Month([Today]) and [DayOfMonth] <= Date.Day([Today]) then 1 else 0)
in
    #"Added Custom1"

Greg
eDNA Forum - Dates before today in every year.pbix (382.8 KB)

Hello @WimH ve noticed that no response has been received from you since a few days ago.

We just want to check if you still need further help with this post?

Thanks for the answer, problem is solved