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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Don-Bot
Helper V
Helper V

Apply TimeZone offset from offset table to datetime table with snowflake schema

I have a Snowflake Schema setup where I have a main Ticket table which is connected to a DateTime table.  Then in order for me to see what timezone the records are in I need to connect to a Call Center Table which is then connected to the TimeZone offset table.  How can I set this up so that I can apply the appropriate timezone offset to the datetime table?

 

I've tried creating calculated columns that work with these but everything I try fails.  

 

DonBot_0-1732120509927.png


EDIT:  

I have tried different methods  to achieve this with some success in finding a work around but none in auto assigning a timezone.  Below is an update I put as a reply in this post.  I've modified my original ask as well.

I am working with a Apps Own Data embedded setup for Power BI.  The semantic model is an import model coming from databricks.  

 

The model is also now setup as  a star schema.  

 

Below is some fake data.  The data comes into our system as EST.  I would like to be able to pass the timezone offset from javascript via embedded and auto setup the timezone the user sees.  

I have tried the following measures with no success (as they keep timing out).  A user may create a table visual with thousands of rows in it with their datetimes laid out in it. 

 

I hardcoded the -3 below just to try to convert to PST from EST.

 

 

AdjustedCreateDateTime = 
    CALCULATE(
        MAX('CreateDateTime'[CreateDateTime]) + -3/ 24
    )


Fact Table

TicketIDCreateDateTimeIDItemCount
a2205541
b2207461
c2207471
d2207481
e2207491
f2207501
g2207511
h2207521
i2207531
j2207541
k2207551
l2207561
,2207571
m2207581
o2207591
p2207601
q2207611
r2207621
s2207631
tt2207561
u2207571
v2207581
ww2207591
sx2207601
df2207611
sdf2207621
sdfa2207631

 

 

CreateDateTime

DateTimeIDDateIDDateTIME
22102392541/2/2024 13:00
22074692371/1/2024 0:00
22074792371/1/2024 1:00
22074892371/1/2024 2:00
22074992371/1/2024 3:00
22075092371/1/2024 4:00
22075192371/1/2024 5:00
22075292371/1/2024 6:00
22075392371/1/2024 7:00
22075492371/1/2024 8:00
22075592371/1/2024 9:00
22075692371/1/2024 10:00
22075792371/1/2024 11:00
22075892371/1/2024 12:00
22075992371/1/2024 13:00
22076092371/1/2024 14:00
22076192371/1/2024 15:00
22076292371/1/2024 16:00
22076392371/1/2024 17:00
22076492371/1/2024 18:00
22076592371/1/2024 19:00
22076692371/1/2024 20:00
22076792371/1/2024 21:00
22076892371/1/2024 22:00
4 REPLIES 4
Greg_Deckler
Super User
Super User

@Don-Bot Well, you can either make your Tickets to Call Center and Call Center to Timezone Offset relationships Both directions or you can use LOOKUPVALUE or MAXX( FILTER( ... ), ... ) to lookup your values. Lookup the Call Center from and then lookup the Timezone offset.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler ,
I have tried adding the below LookupValue as a measure in the DateTime table but I get the error The column 'One Call Center[Timezone]' either doesn't exist or doesn't have a relationship to any table available in the current context.

DonBot_0-1732122893121.png

 

Placing this measure in the CreateDate table gives a Query has exceeded the available resources error as well

Also, I don't care for the "Max" in the query below so will look into how to replace that

TimezoneOffset test =

 LOOKUPVALUE(
    'TimeZone Offset'[Offset],
    'TimeZone Offset'[TimeZone],
    MAX('One Call Center'[TimeZone])
)



 

@Don-Bot I'm not sure that you can use RELATED since they are not related ( your relationship direction is not the right direction from what I can tell ). Sample data would really help to arrive at a solution here.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler ,
Let me know if this helps.  

I am working with a Apps Own Data embedded setup for Power BI.  The semantic model is an import model coming from databricks.  

 

The model is also setup as  a star schema.  

 

Below is some fake data.  The data comes into our system as EST.  I would like to be able to pass the timezone offset from javascript via embedded and auto setup the timezone the user sees.  

I have tried the following measures with no success (as they keep timing out).  A user may create a table visual with thousands of rows in it with their datetimes laid out in it. 

 

I hardcoded the -3 below just to try to convert to PST from EST.

 

 

 

 

 

 

 

 

 

 

 

 

 

AdjustedCreateDateTime = 
    CALCULATE(
        MAX('CreateDateTime'[CreateDateTime]) + -3/ 24
    )

 

 

 

 

 

 

 

 

 



Fact Table

TicketIDCreateDateTimeIDItemCount
a2205541
b2207461
c2207471
d2207481
e2207491
f2207501
g2207511
h2207521
i2207531
j2207541
k2207551
l2207561
,2207571
m2207581
o2207591
p2207601
q2207611
r2207621
s2207631
tt2207561
u2207571
v2207581
ww2207591
sx2207601
df2207611
sdf2207621
sdfa2207631

 

 

CreateDateTime

DateTimeIDDateIDDateTIME
22102392541/2/2024 13:00
22074692371/1/2024 0:00
22074792371/1/2024 1:00
22074892371/1/2024 2:00
22074992371/1/2024 3:00
22075092371/1/2024 4:00
22075192371/1/2024 5:00
22075292371/1/2024 6:00
22075392371/1/2024 7:00
22075492371/1/2024 8:00
22075592371/1/2024 9:00
22075692371/1/2024 10:00
22075792371/1/2024 11:00
22075892371/1/2024 12:00
22075992371/1/2024 13:00
22076092371/1/2024 14:00
22076192371/1/2024 15:00
22076292371/1/2024 16:00
22076392371/1/2024 17:00
22076492371/1/2024 18:00
22076592371/1/2024 19:00
22076692371/1/2024 20:00
22076792371/1/2024 21:00
22076892371/1/2024 22:00


I was able to get it to work with a parameter field selector but our preferred method would be an auto assigned timezone.  Which all the below is pre-created timezone fields that the user can select.

Working method:

DonBot_0-1734109457503.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.