Forum Discussion
Automatic refresh not appearing on Last refresh card
- 1 year ago
Hi 4jhill ,
Thank you for your question, and great points raised by Tutu_in_YYC and tharunkumarRTK .
It's true that ensuring the query is included in the dataset refresh and refreshing the browser after a scheduled refresh are important steps to check.
In addition to that, I’d like to share a solution that ensures the 'Last Refresh' card reflects the automatic refresh.
>Modify the query as below
let
CurrentUTCDateTime = DateTimeZone.UtcNow(),
CurrentLocalDateTime = DateTimeZone.SwitchZone(CurrentUTCDateTime, 2),
LocalDateTime = DateTimeZone.RemoveZone(CurrentLocalDateTime) // Remove the time zone metadata for consistency
in
LocalDateTime
Now again publish the report to the service and configure the schedule refresh.
This time it should work and display the correct date/time in the card.
Hope this helps. Please accept as solution so that other users can benefit from it. Kudos would be appreciated.
Best Regards.
How did you create the last refresh card? DAX? or Power Query? what is the code?
Try this query and use this for last refresh:
let
Source = DateTime.FixedLocalNow(),
#"Converted to Table" = #table(1, {{Source}})
in
#"Converted to Table"
You may have to adjust timezone
I used Power Query:
let
Source = DateTime.From(DateTimeZone.SwitchZone(DateTimeZone.FixedLocalNow(),2)),
#"Converted to Table" = #table(1, {{Source}}),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type datetime}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Last refresh date/time"}})
in
#"Renamed Columns"
- Tutu_in_YYC1 year ago
Super User
yeah this should work just fine. Check 2 things:
1. if the query is included in refresh2. after the scheduled refresh in power bi service, refresh the browser. Sometimes the browser cache the previous value