cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Daniel1
Regular Visitor

Error free measure from Power BI Desktop returns an error after publishing

Hi all,

I created my first dashboard in Power BI desktop and everything was working fine. After publishing the dashboard to power BI online one of my measures returns an error.

 

Measure: YTD2017 = CALCULATE(SUM(APEWeekly[GAP CZK]); DATESBETWEEN(DateDimension[DateKey];"27.12.2016";LASTDATE(DateDimension[DateKey])))

 

The error message is: MdxScript(Model) (4, 99) Calculation error in measure 'APEWeekly'[YTD2017]: Cannot convert value '27.12.2016' of type Text to type Date.

 

I understand that there is a problem with the date format for 27th December 2016. But I have no idea why as there is no error and the measure works in the Power BI desktop.

 

For clarification, the measure calculates YTD sales and I can't use the YTD function as our year starts on 27th of December 2016.

 

Thank you for your help.

 

Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

Re: Error free measure from Power BI Desktop returns an error after publishing

I don't think it has anything to do with that specific date, but with the way you're entering it. Instead of "27.12.2016" try using the DATE() function.


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User I
Super User I

Re: Error free measure from Power BI Desktop returns an error after publishing

I don't think it has anything to do with that specific date, but with the way you're entering it. Instead of "27.12.2016" try using the DATE() function.


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!

View solution in original post

Daniel1
Regular Visitor

Re: Error free measure from Power BI Desktop returns an error after publishing

Perfect, thank you very much! Now it works fine.

Super User I
Super User I

Re: Error free measure from Power BI Desktop returns an error after publishing

I hardly ever trust localized date order to work properly in Power BI or Excel. And I'm in the US. If it's at all possible to use a function to make the month and day explicit in a date, I always recommend using that option instead of letting the program try to parse a whole date.


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors