Forum Discussion
asdaifallah
8 years agoNew Member
Create a column with a specific date
I am trying to create a column with a specific date (date only) using M-query. this will be the report date. whereby i will calculate an aging to some other data. I am not looking for today's...
- 8 years ago
If your problem has been resolved, please help accept solution. Your contribution is highly appreciated.
MarcelBeug
8 years agoCommunity Champion
Looks like you need a parameter for your reference date.
No need to add a column with the reference date: you can use the parameter value to calculate the aging.
But you can still add a column with the reference date, though.
Both are included in this query:
let
Source = #table(type table[Date = date],List.Zip({List.Dates(#date(2017,1,1),20,#duration(15,0,0,0))})),
AddedAging = Table.AddColumn(Source, "Aging", each RefDate - [Date], type duration),
AddedRefDate = Table.AddColumn(AddedAging, "RefDate", each RefDate, type date)
in
AddedRefDate
asdaifallah
8 years agoNew Member
Thank you so much. Appreciate the quick help!