Forum Discussion
Refresh time on visual
- Anonymous5 years ago
Hi adnankabina ,
In your scenario, you should use Calculated Column or M Query instead of Measure.
The former will refresh time after the dataset was refreshed, the latter will refresh time after the page was refreshed.
For calculated column, right click on the table and create a new column using your formula.
For M Query, open query editor and add custom column with below formula.
DateTime.LocalNow() + #duration(0,4,0,0)Best Regards,
Jay
Hi AnkitKukreja,
Should I do in blank query or create a measure. I didnt get you.
This is what I did in blank query but go error.
= DateTime.From ( [DateTime] ) + #duration(0, +5,0,0)
Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?
Hi adnankabina
As you would have created your timestamp column by using blank query earlier, where you were getting time which was off by 4 hours. In the same table use this query by adding custom column.
Or in the same query use the below code, by deleting your full code in advance editor of this table and replace it by below code.
let
Source = DateTime.LocalNow(),
#"Converted to Table" = #table(1, {{Source}}),
#"Inserted Date" = Table.AddColumn(#"Converted to Table", "Date", each DateTime.Date([Column1]), type date),
#"Inserted Time" = Table.AddColumn(#"Inserted Date", "Time", each DateTime.Time([Column1]), type time),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Time",{{"Column1", "DateTime"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "DateTime MyZone", each DateTime.From ( [DateTime] ) + #duration(0, +5,0,0))
in
#"Added Custom"
Or you can just add custom column in your current table and use my last m code that I shared.
Thanks,
Ankit