Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Power Query - Static timestamp?

Hi all,

 

I am new to Power Query/Power BI, and I am still finding my way around.

 

In our company, we update a Power BI on a weekly basis, and it is crucial to document the date of the respective update.

This date should be static and not change with the update in the next week - is there a way to do this?

 

I tried 

 

DateTime.FixedLocalNow()

 

 but the date seems to change with every new refresh.

 

Any help is much appreciated, thanks!

 

Johanna

  • Because I don't know how to automatically add a static time to the Power BI report, perhaps we can derive this in another way.

     

    How does this refresh process work?  Is the data being added or is it replacing?  What is the data source? It may be there is a time associated with the creation of the data source which can be accessed and added in a column to your report (eg the modification time of a file). 

5 Replies

  • So you only want the timestamp for the initial load? You could replace DateTime.FixedLocalNow() with whatever hardcoded value like #datetime(2022,08,19,11,53,45) that you don't want to change.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      exactly, I just want a timestamp for the initial load. I was hoping there was a somewhat dynamic solution that doesn't need manual work every time, but maybe that's just not working. Thanks though!

  • Because I don't know how to automatically add a static time to the Power BI report, perhaps we can derive this in another way.

     

    How does this refresh process work?  Is the data being added or is it replacing?  What is the data source? It may be there is a time associated with the creation of the data source which can be accessed and added in a column to your report (eg the modification time of a file). 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      the data is being added via Excel. Your idea might be working, I'll give it some more thought on how to integrate it in a smart way.

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Anonymous 

     

    Power BI doesn't support to record the old datetimes it generates in previous refreshes. You need to record the datetimes in the data source, then use Power Query to bring it into your report.

     

    Best Regards,
    Community Support Team _ Jing