Forum Discussion
refreshdate
- 1 year ago
It is probably because the query (that brings the time) was executed once you uploaded the report online.
- 1 year ago
instead of using DAX, which recalculates when you interact with the report, you need to implement it in power query using the following:
https://learn.microsoft.com/en-us/powerquery-m/datetime-localnow
This will return you the time the query is refreshed. Just note that you need to adjust to your timezone, as this function returns date time in UTC
It is probably because the query (that brings the time) was executed once you uploaded the report online.
- Anonymous1 year agoNot applicable
any way to fix this as I have to get the same time for publish and in the report
- zenisekd1 year ago
Super User
You are doing something wrong.
I took the report in desktop
and published it to the service.
It is the same. There is no reason for it to be different.
This is the code for CEST time.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZDLCQAhDAV78Sxonv9axP7bWLNPMN4mDMYhc7oUBAFRmvNOJBTy8r8RnTpNJh8TdRo0iUzT94BIIeTzRBdAaBr5GF0A0FTyMZqGdNM2mwDkG7CZZuhQKEA2ZdWI+pQ1U9ae/7v5v9vTYNzTYNiyFG/Z5rU+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [dtDSTStart = _t, dtDSTEnd = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source, {{"dtDSTStart", type date}, {"dtDSTEnd", type date}}, "en-US"),
varCurrentDate = DateTime.Date(DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),+1)),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [dtDSTStart] < varCurrentDate and [dtDSTEnd] > varCurrentDate),
varDSTOffset = Table.RowCount(#"Filtered Rows"),
#"Last Refresh Date" = #table(
type table [#"Refresh Date"=datetimezone],
{
{DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),+1 + varDSTOffset,0)}
}
)
in
#"Last Refresh Date"
my guess is that you perhaps run a refresh after you put the report to service? Keep in mind that the report in desktop and report in service are not interconnected.