Last answered:

09 Apr 2021

Posted on:

08 Apr 2021

0

Error while working on the first step on Dax

Hi there,
This question may looks stupid but I need to try to save some time.
Could you please help me in relation to an error that happens while typing the code on Dax?
This is the error:

The syntax for 'year' is incorrect. (dax(addcolumns( calendar(min(fact_internetsales[ship date]),max(fact_internetsales[shipdate])), ''year'', year([date]), ''month'', month([date]), ''month name'', month([date]),)).

I tried to find out what is going on but I could not. Also, I downlead and imported the Excel file resource as in the video. Then, I did all the steps as it is in the video.

Regards,
Paulo

4 answers ( 0 marked as helpful)
Instructor
Posted on:

08 Apr 2021

0

Hi Paulo,

Thanks for reaching out, can you please paste the full DAX you are using?

I would try running the following code:
addcolumns( calendar(min(fact_internetsales[ship date]),max(fact_internetsales[shipdate])), ''year'', year([date]), ''month'', month([date]), ''month name'', FORMAT([date],"mmm"))

Kind Regards,
Dimitar Shutev

Posted on:

08 Apr 2021

0

Hi Dimitar,
Thanks for getting back to me. Yes, I can. Please see the full DAX which I am using.

dim_Date = addcolumns(
calendar(min(fact_internetsales[shipdate]),max(fact_internetsales[shipdate])),
''Year'', year([date]),
''Month'', month([date]),
''MonthName'', format([date],"MMMM"),
''DayOfWeek'', format([Date], ''DDDD''),
''Quarter'', format([Date], ''Q''),
''YearQuarter'', format([Date], ''YYYY'')&''/Q''&format([Date], ''Q''))

Looking forward to hearing from you.

Regards,
Paulo

Instructor
Posted on:

09 Apr 2021

0

Hi Paulo,
I don't see anything wrong with the DAX, but could it be that you are using two single ' ' next to each other as opposed to " ?
This is what I can see from your code, please fix them to double quotation marks
image

Posted on:

09 Apr 2021

0

Hi Dimitar,

Working now. I found it in the night time around here. My bad yesterday sorry.

Thanks for your help.

Regards,
Paulo

Submit an answer