PowerBI Advanced Editor Token Comma Expected Error

Jade Poteat 0 Reputation points
2023-02-23T10:04:27.4366667+00:00

Hi! I am trying to return statements in a custom column based on values in another (COMM_SUM).

In Advanced Editor in PowerBI Desktop, I am getting the error "Token Comma expected" and cannot resolve where the issue is.

Many thanks for help in advance.

#"Added Custom" = Table.AddColumn(#"Removed Columns3", "Custom", each [COMM_SUM] if([COMM_SUM] <= 15, then "Missing"), if[COMM_SUM] >= 16 & [COMM_SUM] <= 23, "Early"), if[COMM_SUM] >= 24, & [COMM_SUM] <= 31, "Mid-level" if[COMM_SUM] >= 32, then "Developed")))

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-02-23T16:26:21.3966667+00:00

    Use answers to provide solutions to the user's question.

    Hello there,

    This error is usually caused by a mistake when you write code or copy and paste the code in advance query. You can do these to check the error: click "Show error" and then it will show you where is no comma in the code.

    This article provides suggestions for how to fix the most common errors you might find at each level and describes the error reason, error message, and error detail for each. https://learn.microsoft.com/en-us/power-query/dealing-with-errors

    The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.

    https://community.powerbi.com/t5/Report-Server/Error-Token-Comma-expected/m-p/1636405

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.