Forum Discussion
Convert DateTimeOffset to DateTime
Yes, DateTime.SwitchZone does that offset.
Also cannot spot anything similar to the other function. It looks as if it takes in a text that represents the timezone and then converts it to a timezone value. But that’s actually not what you need at the end: As that’s only the offset-value.
So how about creating a lookuptable instead where the offset-values for all your possible text-values (time zones) are stored? As this wouldn’t change, you just fetch your offset-value from there then.
As the very worst case I would likely do something similar but I would not want to do that because it will not be just key-value pairs, it has to be something smarter which will take into account Day Light Savings Time for specific timezone which eventually means that there are multiple offsets per any time zone, so, that sounds like not just lookup but lookup + logic and if I don't implement that logic my reports would be wrong at least 2 times per year.
I could not beleive that such basic functionality is not available in Power BI, these are just fundamentals for any live report (which Power BI claims to be) to have true support for time zones (Offset can be determined by knowing a time zone but but time zone can not be determined if just offset is known because there are multiple offsets per any time zone).
Is that possible to use .NET language while shaping a data for Power BI ?
- ImkeF10 years agoCommunity Champion
Not to my knowledge, but you can use R in Power BI.
But I definitely recommend that you post this question at stackoverflow. There the MS guys are answering the PQ questions. They might know more about it.
- AverageAsker10 years agoHelper I
I posted in that forum but there are no replies.
So, to close on this: I ended up doing my conversations in SQL due to "Power" BI / "Power" Query limitations
- ImkeF10 years agoCommunity Champion
That's a pity.
But as Microsoft is adding new features month by month with often stem from users requests: How about posting the missing functions in the Ideas section here: https://ideas.powerbi.com/forums/265200-power-bi?