Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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]))Solved! Go to 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])))
    )
)Hi,
My best guess is that this is all you need
=DISTINCTCOUNT('Ticket Location'[State])
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])))
    )
)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
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 85 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |