Forum Discussion

YavuzDuran's avatar
YavuzDuran
Helper III
4 years ago
Solved

Data Transfer - A date column added automatically each day

Hi All, I have a daily run file. and I want to put an extra column of date (of run) to each file (put by query editor or as a calculated column in Power BI Desktop) and want to append the next day's...
  • v-jingzhang's avatar
    4 years ago

    Hi YavuzDuran 

     

    If you want this new date column to be populated by only the newest date, you could use DateTime.LocalNow() as mattww  has suggested. 

     

    However, if you want to add a date column that records every date when a daily file is appended, this is not possible with Power Query or DAX. Every time when you refresh a query, it will evaluate the M codes and DAX codes again and populate columns with the latest calculation results. It will not record older values. So if you want to, for example, add today's date to today's data, and tomorrow's date to tomorrow's data, you need to add these dates to your data source files in advance. 

     

    If your file is covered every day with only current day's data, you need to back up old files daily to avoid losing any historical data. Power BI will not keep historical data for you. It only queries your data source to import existing data from there. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.