Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
Solved! Go to Solution.
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.
Proud to be a Super User!
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.
Proud to be a Super User!
Perfect, thank you very much! Now it works fine.
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.
Proud to be a Super User!
User | Count |
---|---|
84 | |
77 | |
76 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |