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

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

Reply
newpi
Helper V
Helper V

How do I make my Power Query formula accept timezone with decimal points

Hi,

 

I want to create a Power Query Formula, which uses a Parameter that my users can manipulate called as Time Zone. The Parameter type for #Time Zone is decimal right now so it can accept positive & negative values with decimal points.

 

I have a 'datetime' column called Time in (UTC). I want to create a Power Query formula such that I can pass the parameter #Time Zone which would convert Time (UTC) column to match that time zone and update the values in the column. 

 

Eg: if UTC datetime value is 

8/20/2020 14:10:15 UTC

 and my #Time Zone is +5.5 (5:30 mins) then above value should change to 8/20/2020 7:40:15 PM (8/20/2020 19:40:15  IST)

or if my #Time Zone is -5 (5:00 ) then my time value should change to 8/20/2020 9:10:15 AM (8/20/2020 09:10:15 ET)

 

I may have to change the datatype of my #Time Zone parameter from decimal to time or duration according to soultion which is fine but I would prefer in Decimal. 

5 REPLIES 5
Icey
Community Support
Community Support

Hi @newpi ,

 

Is the answer @Jimmy801 provided helpful?

 

If it is, please accept his reply as a solution.

If not, please let us know.

 

 

Best Regards,

Icey

@Icey 
The solution Jimmy provided is helpful in providing me direction but id dint solve the problem for me yet. I'm exploring another solution and will udpate here once I have the answer.

Jimmy801
Community Champion
Community Champion

Hello @newpi 

 

You can use the function DateTimeZone.SwitchZone to accomplish this. This accepts a number to switch the zone. In case you want to use another format afterwards, you could create a function where you manipulate the format, before passing it to the function DateTimeZone.SwitchZone. Here the code

let
    Source = #table
    (
        {"TimeZoneUTC"},
        {{DateTimeZone.FixedUtcNow()}}
    ),
    Add= Table.AddColumn
    (
        Source,
        "Your time",
        each DateTimeZone.SwitchZone([TimeZoneUTC],5.5)
    )
    

in
    Add

 

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

@Jimmy801 I want to use a parameter here and my parameter name is  "#Time Zone" .

 

I do not want to add column as there are dependant columns to my existing one, so want to edit my formula there itself.  My current formula is : 

Screen Shot 2020-08-25 at 2.51.53 PM.png

 

The above formula is working fine when #Time Zone Parameter is whole number like 5 but not working when its a decimal like 5.5

Jimmy801
Community Champion
Community Champion

Hello @newpi 

 

then change the formula to this

= if #"Daylight Savings" = true then DateTimeZone.SwitchZone([#"Activity Time (UTC)"],#"Time Zone" +1) else DateTimeZone.SwitchZone([#"Activity Time (UTC)"],#"Time Zone") 


If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors