Adding Data Refresh Date and Time in Power BI

Body

This article explains how to add a date and time for the last data refresh in Power BI.

Detailed Information

Power BI uses Universal time which causes discrepancies on the reports Power BI Service. Here is one of the remedies for date and time.

  1. Go to Power Query Editor (Transform Data)
  2. Go to New Source > Blank Query. Copy this DAX to Advanced Editor.

    let
        Source = #table(type table[LastRefresh=datetime], {{DateTime.LocalNow()}}),
        #"LocalDateTime" = Table.AddColumn(Source, "LastRefeshLocal", each DateTime.AddZone([LastRefresh], 5)),
        #"Changed Type" = Table.TransformColumnTypes(LocalDateTime,{{"LastRefeshLocal", type datetime}, {"LastRefresh", type datetime}})
    in
        #"Changed Type"
  3. It will create a new table. 
     
  4. Rename the table and  "Close & Apply".
     
  5. Use "LastRefreshLocal" on your report if the report is published to Power BI Service.
     
  6. For daylight saving time, change this line (from "5" to "4")
    #"LocalDateTime" = Table.AddColumn(Source, "LastRefeshLocal", each DateTime.AddZone([LastRefresh], 4)),

Environment

  • Power BI

Details

Details

Article ID: 159306
Created
Fri 5/10/24 4:46 AM
Modified
Wed 2/5/25 7:31 AM
Applies To
Staff
Community