Dynamic Date Query Table

Hi @avalon.ds ,

I use M code to get the first and last date on my sales or fact table and then add an amount of days to it:

Normal date table:

M date table:

The difference is in the Source, you create a normal date table then go to the source and use M language.

List.Min(FactTable[DateColumn]) => this will give you the start date of your FactTable data

List.Sum({List.Max(FactTable[DateColumn]), #duration(30, 0, 0, 0)}) => this will get the last date on your FactTable and #duration will add the amount of days you decide.

Also, be careful in always adding {} inside the List.Sum, otherwise you will get an error.

2 Likes