cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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.

Highlighted
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
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors