Date Table Odd Behavior

I have the date table from the intro courses on EDNA, I was creating a table from Jan 1, 2019 thru Dec 31 2021 in the parameters, but the output keeps dropping the last date of 12/31/21.

Any idea why this would happen?

@Despo

Small Change in your Dates Query function, just add 1 to DayCount

Can you help me understand whats wrong? I have used this date table a lot and never observed this behavior

Hi @Despo,

Like @Rajesh showed here

image

The DayCount variable counts the difference in days between Start- and Enddate. Now if both Start- and Enddate should be included then you have to add 1 to its result -as depicted above.

If it’s still not exactly clear then paste this M code in a new Blank Query.
It spans a full year right so the query should return 365… (spoiler, not unless you include both dates)

let
    Source = Duration.Days( Duration.From( #date(2021, 12, 31) - #date(2021, 1, 1) ))
in
    Source

I hope this is helpful.

2 Likes