Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I get an incorrect syntax error for the DATETIME strings in the example below:
The syntax for "2015-08-16" is invalid.
I tested with Power-BI versions of June and May as well what gives the same error message!
My Input method is:
English (United States) and Belgian (Period) keyboard.
hi, @dirkjs
If it is the format error as below:
CustomFiscalPeriods = DATATABLE ( "Fiscal YearNumber", INTEGER, "FirstDayOfYear", DATETIME, "LastDayOfYear", DATETIME, { { 2016, "28-06-2015", "2016-07-02" }, { 2017, "2016-07-03", "2017-07-01" }, { 2018, "2017-07-02", "2018-06-30" }, { 2019, "2018-07-01", "2019-06-29" } } )
Please adjust it as below, then it should work well.
Table = DATATABLE ( "Fiscal YearNumber", INTEGER, "FirstDayOfYear", DATETIME, "LastDayOfYear", DATETIME, { { 2016, "2015-06-28", "2016-07-02" }, { 2017, "2016-07-03", "2017-07-01" }, { 2018, "2017-07-02", "2018-06-30" }, { 2019, "2018-07-01", "2019-06-29" } } )
Result:
Best Regards,
Lin
I don't see "2015-08-16" in your formula, but I see "28-06-2015". Maybe that's the one causing the issue? Actually, when I test it out on my desktop both of those work for me. I'm using the July 2019 version.
Maybe try adjusting it to match the other dates formats to see if that works.
Thanks for your response, but, both notations "28-06-2015" as "2015-06-28" do not work!
Can you post a screen shot of what you see? It workes fine for me which is weird. You're trying to create a new table and not a column, correct?
That is true. I try to create a table with 3 columns.
This is something for Power BI Development Team. I tried to comment the second field and I got the following strange result!
hi, @dirkjs
Could you try my sample pbix to check it if works well.
Best Regards,
Lin
Dear Lin,
Thanks for your kind support. When I load your demo.pbx, the database is created and loaded, BUT, the syntax error remains(!) and when I hit one [RETURN] in the formula panel, I loose the data in the tabel like you see in my screenshot below.
I have more syntax errors! This file is from the website Power BI Tips & Tricks,
See the following screen shot!
I could find it. It is really a BUG in Power BI or even DAX. If I add a space before the comma seperator like you see below, there are no syntax errors anymore! So Microsoft developpers, you know what to do.
The same is true for the DATETIME function. Add a space before the comma like below and the problem is solved.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |