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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Zalina
Advocate I
Advocate I

List.Dates function to add dates in CET instead of UTC

Hi All,

I have a daily report that refreshes every midnight CET, however since Power BI Service uses UTC I get blank date instead of a new date past midnight CET, since in UTC it's still the previous date, so the new date is not getting added.

I am using the following function to list dates and am using that as my date table:

= List.Dates(Source, Number.From(DateTime.LocalNow())-Number.From(Source),#duration(1,0,0,0))

Is there a way of adjusting this function so that it lists dates based on CET instead of UTC? Or maybe at least hardcoding a time offset?
I have created a column that converts the date/time from UTC into CET even taking into account the daylight saving offset, but all of that is useless if the new date is not getting added to the table.

2 REPLIES 2
edhans
Super User
Super User

Replace your DateTime.LocalNow with this:
DateTime.From(DateTimeZone.SwitchZone(DateTimeZone.LocalNow(), -7))

That will return the DateTime of the Mountain time zone. Adjust the hour offset for your needs.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thanks, I tried your suggestion, tested after midnight today but the chart still came back with blank where today's date should be (11th).
Any other ideas?

Zalina_0-1676110804378.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors