Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

The syntax for ')' is incorrect.

I've searched for this and the typical suggestion is that the Return is needed.  I'm using this in a new column, does it need to be a measure?  What is the issue?  I need to have a few of these but figured I'd get one right first.

 

 

11 Replies

  • Hi GQ, 

    Can you try returning the variable you have created? 

     

    TestReq = 

    var CHAG = RELATEDTABLE(CHAGAS)

    RETURN CHAG

     

    You can define a variable in any DAX expression by using VAR followed by RETURN. In one or several VAR sections, you individually declare the variables needed to compute the expression; in the RETURN part you provide the expression itself (Source: SQLPBI)

     

    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, and Kudos 👍 are very much appreciated!

    - YJ

  • Anonymous's avatar
    Anonymous
    Not applicable

    I got a new error.

    @AnthonyJoseph - the link did not work

    unicorns 

    • unicorns's avatar
      unicorns
      Helper II

      Hi GQ, 

       

      I just read your post again and if you are trying to use this in a 'new column' then it should be a measure. I think that formula is returning an entire table, which you can't use for a column since it's returning multiple columns. 

       

      you should assign your code to a measure in this case. I think you can use filters+aggregate functions in your code to ensure you are returning a measure instead of entire table. let me know if I can help. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        I'm getting the same error as a measure.

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 

    which column from that table would you like to return? What is the relationship between the two tables?

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 

    which column from that table would you like to return? What is the relationship between the two tables?

    • Anonymous's avatar
      Anonymous
      Not applicable

      I want to return the 1st column which is a member number.  It is unique and it linked to another table by that number.  Essentially, if the member is not in that table, I need to concatenate another literal to a message column.  (see my reply to unicorn in this thread with my needed logic.)