Search code examples
powerbidatetime-formatutcpowerbi-desktoppowerbi-custom-visuals

How to get Date from UTC Date time in power bi?


I'm trying to get UTC Date time to Date in power bi, i have tried in following way but it wont work,

UTC Date : DateTime.ToText(DateTimeZone.UtcNow(),"yyyyMMdd") --> Throwing Error

Local Date: DateTime.ToText(DateTime.LocalNow(), "yyyyMMdd") --> 20200508

The problem here is Local Date i can able to format but UTC Date i'm not able to format why?


Solution

  • After tried many time i got one way to work it

    DateTime.ToText(Date.From(DateTimeZone.FixedUtcNow()),"yyyyMMdd") --> 20200508