Forum Discussion

jmsny's avatar
jmsny
Frequent Visitor
1 year ago
Solved

Unexpected expression COLUMN

Creating a column is taking hours, so I wanted to use DAX query view to define it as I've done for measures in the past.  It should be possible according to Microsoft, but I'm instead getting an error and cannot run it.

 

 

The text afterwards is removed here since it's all underlined in red and says unexpected expression as well, but it doesn't matter what I try to define it as, it'll give me the same error.

 

How can I get this working as it's supposed to work?  It can't be a measure.  Thanks.

  • Hi jmsny,

     A column using DEFINE COLUMN in DAX Query View should work, but currently, Power BI doesn't support creating calculated columns through DAX Query View.

    This is why you're seeing the "unexcepted expression COLUMN" error, no matter what DAX expression you use.

    At the moment, only measures, variables, and evaluate statements are supported in DAX Query View.

    If you need to create a new column, the recommended approach is to:
      Go to the Data view or Model view,Select your table,Use the "New column" option to write your DAX expression.
    To create a column, please use the "New column" option in Data or Model view instead.

    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

     

    Best Regards,
    Harshitha.
    Community Support Team.

6 Replies

    • v-hjannapu's avatar
      v-hjannapu
      Community Support

      Hi jmsny,
      I would also take a moment to thank Deku , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

      I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please Accept it as a solution so that other community members can find it easily.


      Thank you
      Harshitha.
      Community Support Team.


    • jmsny's avatar
      jmsny
      Frequent Visitor

      No matter what I put after DEFINE COLUMN, it still shows an error and will not run.  I went and did it individually, but doing it in Dax Query mode does not work for me on the latest update.

      • v-hjannapu's avatar
        v-hjannapu
        Community Support

        Hi jmsny,

         A column using DEFINE COLUMN in DAX Query View should work, but currently, Power BI doesn't support creating calculated columns through DAX Query View.

        This is why you're seeing the "unexcepted expression COLUMN" error, no matter what DAX expression you use.

        At the moment, only measures, variables, and evaluate statements are supported in DAX Query View.

        If you need to create a new column, the recommended approach is to:
          Go to the Data view or Model view,Select your table,Use the "New column" option to write your DAX expression.
        To create a column, please use the "New column" option in Data or Model view instead.

        If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

         

        Best Regards,
        Harshitha.
        Community Support Team.