Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
I have created a Calendar table in Power BI Service using DAX for a Power BI report I am creating. The calendar includes columns which check if the row is equal to the current day, current month, current year, etc. These values are used in filtering the Power BI report visuals.
This generally works well except that the calcualtions are based on UTC, so, they are wrong for me when viewing them after 4:00PM Pacific Time (since this is 12:00AM UTC). I have tried to find a solution online, but the syntax does not seem to work for me given how my table is constructed.
For example, the "Is Current Day" field is calculated by using the Date.IsInCurrentDay function, but this function using UTC:
#"Added Custom12" = Table.AddColumn(#"Added Custom11", "Is Current Day", each Date.IsInCurrentDay([Date])),
Can anyone assist or provide an example of how to create a DAX-based Calendar table with time zone conversion? Alternatively, is there another way to create a dynamic calendar table using Power BI Service (not Desktop)?
The code for my tables is as follows:
Solved! Go to Solution.
Hi @craigmday Below is an example on how to add the timezone offset and you can specify what the offset should be.
,
#"Added TimeZoneOffset" = Table.AddColumn(#"Added Custom18", "TimeZoneOffset", each 2), // Adjust the offset as needed
#"Adjusted DateTime" = Table.AddColumn(#"Added TimeZoneOffset", "Adjusted DateTime", each DateTime.AddZone(DateTime.From([Date]), [TimeZoneOffset]))
in
#"Adjusted DateTime"
Hi @craigmday,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi Vinay,
Thank you, I was able to get this to work based on everyone's feedback. This is resolved.
Cheers,
Craig
Hi @craigmday,
we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @craigmday Below is an example on how to add the timezone offset and you can specify what the offset should be.
,
#"Added TimeZoneOffset" = Table.AddColumn(#"Added Custom18", "TimeZoneOffset", each 2), // Adjust the offset as needed
#"Adjusted DateTime" = Table.AddColumn(#"Added TimeZoneOffset", "Adjusted DateTime", each DateTime.AddZone(DateTime.From([Date]), [TimeZoneOffset]))
in
#"Adjusted DateTime"
Hi @craigmday,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power BI Service operates in UTC, so DAX does not directly support time zone conversions. Because Power BI Service runs on UTC, you need to adjust the date comparison logic by subtracting the time difference between UTC and Eastern Time.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
42 | |
26 | |
23 | |
20 | |
17 |
User | Count |
---|---|
54 | |
43 | |
24 | |
21 | |
20 |