Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PbiwithPrasad
Helper I
Helper I

i need the deneb vega clock need to take my measure and shoe date n time accordingly

i need the deneb vega clock need to take my measure and shoe date n time accordingly , for examples utc + 5:00 hours  which is my desired time zone   time  and  how can i show it? pl help me urgent.

 

in Vega examples we have a templet for clock but it works for now(), but i want it need to work for my desired zone, may be it can use a measure from data set or can be done inside the vega code , but it need to work for may desired time zone time.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PbiwithPrasad ,

 

You can use the Vega clock template in Power BI, but you need to modify it to show the time in your desired time zone. One way to do this is to use the DateTime.AddZone() and DateTimeZone.SwitchZone() functions in Power Query Editor to convert the UTC time to your desired time zone. You can then use this converted time in your Vega code to display the clock. Here is an example of how to do this:

  1. Load your data into Power Query Editor.
  2. Create a custom column using the following formula to add the default UTC time zone to your time column: DateTime.AddZone([Time],0)
  3. Create another custom column using the following formula to switch the time zone to your desired time zone: DateTimeZone.SwitchZone([ZoneTime],[UTC])
  4. Format the new column into date/time/timezone format.
  5. Use the converted time in your Vega code to display the clock.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @PbiwithPrasad ,

 

You can use the Vega clock template in Power BI, but you need to modify it to show the time in your desired time zone. One way to do this is to use the DateTime.AddZone() and DateTimeZone.SwitchZone() functions in Power Query Editor to convert the UTC time to your desired time zone. You can then use this converted time in your Vega code to display the clock. Here is an example of how to do this:

  1. Load your data into Power Query Editor.
  2. Create a custom column using the following formula to add the default UTC time zone to your time column: DateTime.AddZone([Time],0)
  3. Create another custom column using the following formula to switch the time zone to your desired time zone: DateTimeZone.SwitchZone([ZoneTime],[UTC])
  4. Format the new column into date/time/timezone format.
  5. Use the converted time in your Vega code to display the clock.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

how do i need to add this converted time in Vega code to display the clock.

ppm1
Solution Sage
Solution Sage

In the Vega clock template, replace "now()" with this expression, updated with the # of hrs you'd like to offset.

 

"timeOffset('hours', now(), 2)"

 

Pat

Microsoft Employee

thak you @ppm1  , i got your point we can use utcoffset(),but how can we make it to take hours and minuits form two measures , i dont have idea on it can you plz make the code in detail. 

 

below is the default clock code. i need it to work with my measure. if my measures ( hours &minuits ) result is 5 H and 30 Min , it need to show utc + 5:30.

 

Thanks in advance

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.