Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX syntax error

Hi, I'm new to Power BI. It's a bit annoying that sometimes I entered a DAX formula which seemed to work at the beginning. When I reopen the file some time later, I got an error message. 

Do I need to adjust my computer time set up to make the function work?

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous 

    You can not use Calender () in a column, Calendar() is a table expression that returns a table with a single data column. You can use your formula to create a New Table as the calender and then relate it with the Date column in the original table.

     

    https://docs.microsoft.com/en-us/dax/calendar-function-dax


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
      

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    You can not use Calender () in a column, Calendar() is a table expression that returns a table with a single data column. You can use your formula to create a New Table as the calender and then relate it with the Date column in the original table.

     

    https://docs.microsoft.com/en-us/dax/calendar-function-dax


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
      

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, Paul! You are right about this is a table function. . It looks I also need to adjust date configuration in my computer to make the function work.  

  • Anonymous what happens if you press enter, do you have to change anything. I noticed sometimes you get those red lines in dax editor even your expression is correct.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.