Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Don-Bot
Helper V
Helper V

Syntax Error in Dax parsing invalid token

I'm getting a "The following syntax error occurred during parsing invalid token line 3, offset 36" in this dax and I have no idea why.  I also can't seem to find much on what that error is trying to tell me.

 

Can anyone help?

DistinctStateCount TEST = CALCULATE(
    DISTINCTCOUNT('Ticket Location'[State]),
    VALUES('Registration'[CDC_ID]))
1 ACCEPTED SOLUTION

I was trying to only count states that had a registration code and how many states that had that registration code.  Was able to accomplish it with this


CALCULATE(
    DISTINCTCOUNT('Ticket Location'[State]),
    FILTER(
        'Ticket',
        NOT(ISBLANK(RELATED('Registration'[CDC_ID])))
    )
)

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

My best guess is that this is all you need

=DISTINCTCOUNT('Ticket Location'[State])

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

What are you trying to achieve with the VALUES filter?

I was trying to only count states that had a registration code and how many states that had that registration code.  Was able to accomplish it with this


CALCULATE(
    DISTINCTCOUNT('Ticket Location'[State]),
    FILTER(
        'Ticket',
        NOT(ISBLANK(RELATED('Registration'[CDC_ID])))
    )
)
Anonymous
Not applicable

Hi, @Don-Bot 

Thank you a lot for sharing DAX, and if it solves your problem, you can mark your reply as a solution so that others in the community can quickly find an answer if they have a similar problem.
Your sharing will contribute to the development of the community with us! Thank you again!

 

 

Best Regards

Jianpeng Li

FreemanZ
Super User
Super User

hi @Don-Bot ,

 

VALUES() alone can not be used here as filter argument.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors