Forum Discussion
Best Practice For Displaying Date/Times in Local Time Zone
Hey Gilbert,
Thanks for the detailed response much appreciated. I will review in detail later today.
On question 1 though I woke up this morning and everything sunk in. You are correct creating the additional columns in PQ will be more effecient. However, this method does require you to create new date/time columns for every time zone your report needs to support.
If I were to add more time zones to the daylight savings table in PQ and then use calculated columns in DAX to create the local date/time columns I can use a slicer to filter the daylight savings table and reference the offset value.
Whilst from a performance point of view this will be slower compared with PQ it will be faster and more effecient overall as you are only duplicating each date/time column in your model once. If you were to do it in PQ you need a new date/time column for every time zone you want to support which just gets exponentially large.
So in summary their doesn't seem to be a "best practice" so to speak. Both PQ and DAX have their advantages/disadvantages. It's up to the architect to think through the model, end user requirements and choose the method that will result in the best performance.
I haven't tested my theory above yet so I could be completely wrong but it makes sense in my head 😂🤣 I will reply here once I have tested it and proven the theory.
Cheers,
Fly Kick
For Question 3 I would strongly recommend that you do not attempt to create that calendar table in Power Query or DAX. Instead create a Calendar table externally (in SQL Server, or a sharepoint file etc). This will save you a lot (a lot) of sanity.
Once you include business hours you also need to start thinking what to do when your users record activities outside of the standard hours. For example what should happen when someone starts working on Monday 6am or finishes on Saturday morning 10am etc. What should the granularity be? Is 10:15am different from 10:00 am etc,
If and when you have well defined rules for these cases you can then implement these rules in your DAX measures and create cross join tables with the required granularity.
- FlyKick4 years agoHelper II
Thanks for the advice lbendlin, sounds like I may be out of my depth with this one. Might have a poke around and see if I can find a a PBI consultant that might be able to do it for us 😉 Cheers