Forum Discussion

asdaifallah's avatar
asdaifallah
New Member
8 years ago
Solved

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 date though.

 

for example, i want all the column to include the same date of 1-Dec-2017.

 

thanks in Advance

  • asdaifallah,

     

    If your problem has been resolved, please help accept solution. Your contribution is highly appreciated.

4 Replies

  • MarcelBeug's avatar
    MarcelBeug
    Community 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

     

      • v-chuncz-msft's avatar
        v-chuncz-msft
        Community Support

        asdaifallah,

         

        If your problem has been resolved, please help accept solution. Your contribution is highly appreciated.