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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
martijnth
Helper II
Helper II

Publish gives different results then the Desktop version

Dear Reader,

when i publish a dashboard with a DAX code like below:

Planned Num = CONCATENATE(round(FORMAT(now(),"hh")*55+right(format(now(),"hh:mm"),2)*(55/60),0)-55*6, " Planned Gt's")

the result it gives in Desktop is correct, however 'Published' it gives a totally different result, i have no idea why or how i can check where it is going wrong. All help is appreciated.

reg martijn

 

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Appears that the NOW() Statement always returns UTC time and that can not be changed in service.... 

https://community.powerbi.com/t5/Service/Set-local-time-zone-Power-BI-Service/td-p/114120

I would suggest getting the local time in PowerQuery, just make a standalone 1 row table. Then use that instead of the now() statement!

DateTime.LocalNow()


/ Johannes


Connect on LinkedIn

View solution in original post

7 REPLIES 7
tex628
Community Champion
Community Champion

This is a wild guess, but sometimes it seems like the locale and timezones differ between desktop and service, meaning that your NOW() statement would return a different timestamp when you publish it!

 /Johannes


Connect on LinkedIn

Hi Tex628,

yes this would be my guess as well, but now i need a solution, any idea?

reg martijn

tex628
Community Champion
Community Champion

Appears that the NOW() Statement always returns UTC time and that can not be changed in service.... 

https://community.powerbi.com/t5/Service/Set-local-time-zone-Power-BI-Service/td-p/114120

I would suggest getting the local time in PowerQuery, just make a standalone 1 row table. Then use that instead of the now() statement!

DateTime.LocalNow()


/ Johannes


Connect on LinkedIn

unfortunately Format only works on falue, so i used 

Planned Num = CONCATENATE(round(FORMAT(UTCNOW()+2/24,"hh")*55+right(format(UTCNOW()+2/24,"hh:mm"),2)*(55/60),0)-55*6, " Planned Gt's")

works aswell, thanks all

tex628
Community Champion
Community Champion

You can check it by just putting a NOW statement in a card and comparing the results.. 

I'm gonna need some time to check if it's possible to change to locale in service. Otherwise you have to do some messed up solution with paralellperiod to account for the timedifference...


Connect on LinkedIn
vanessafvg
Super User
Super User

@martijnth 

 

are you using the same data?

what is the published vs the deskop vs showing?

do you have filters on in the published?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




are you using the same data? YES

what is the published vs the deskop vs showing?

    Published: 112 Planned GT's, 

    Desktop: 221 Planned GT's

No filters, same report, just published

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.