cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
viwinski7
Frequent Visitor

Issue with Timezone Conversion

Hi all, 

 

So I am having the hardest time with converting my power bi Reports to Central time. I have changed the time zone using DateTimezone.Switch Zone, looked through all of the forums, but I still can't do it correctly. Currently, How I am doing this is I've made my date data Time and Date data, and then I convert using above M by -5 (from UTC Time). Then, I use that new column in my visual. 

 

The code I am using to pull the data for the visual is this: 

 

COALESCE(COUNTROWS(FILTER('Census',[Exit Date Central].[Date] = TODAY())),0)

 

I want to create DAX codes that will pull a total number of times something occurs within the day so for example. I want to show how many exits there were between 12a-12a on May 19th in Central Time. 

 

I'm very new to Power BI, so if there is another way that this can be done please provide me all of your wisdom! 

 

Thank you! 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@viwinski7 ,Based on what I got from the problem

You have utctoday() and utcnow(), that you can use and add time to get your time zone

 

new =

var _1= utcnow() + time(5,30,0)

return 

date(year(_1), Month(_1), day(_1))

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@viwinski7 ,Based on what I got from the problem

You have utctoday() and utcnow(), that you can use and add time to get your time zone

 

new =

var _1= utcnow() + time(5,30,0)

return 

date(year(_1), Month(_1), day(_1))

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Thank you for your insights. However, when I do this, I'm still getting data that was captured from the previous day. So instead of 31 exits from our facility, I am still getting 36. . . because last night after 7pm there were 5 more exits. how do I make it so it's only counting the number of exits between 12a-12a in Central time? 

 

here is my updated code: 

 

Coalese(Countrows(Filter('Census', [Exit Date]. [Date] = DATE (Year(Var_1), MONTH (Var_1), DAY(Var_1)))),0)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!