Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Invalid Token: Measure in PowerBI

Good morning all I'm trying to create a measure to give me a % of assessments that were completed in a given period of time, but I keep getting the invalid token error, the trouble is I'm not sure w...
  • v-kkf-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    This error message is an indication that there is a problem with your syntax. I found an extra "]" in your code, please remove it and run it again. 

     

     

    Also, you can format the DAX in this URL https://www.daxformatter.com/  to make it more beautiful.

     

    upcoming Assessments Complete =
    CALCULATE (
        DISTINCTCOUNT ( ASSESSMENT_TASKS[MEMBER_NBR] ),
        OR (
            ASSESSMENT_TASKS[ASSESSMENT_STATUS] = "Assessed late",
            ASSESSMENT_TASKS[ASSESSMENT_STATUS] = "Assessed on time"
        ),
        OR (
            ASSESSMENT_TASKS[DAYS UNTIL DUE] = "14 DAYS OR LESS",
            ASSESSMENT_TASKS[Days Until Due] = "15 TO 45 DAYS"
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( ASSESSMENT_TASKS[MEMBER_NBR] ),
            OR (
                ASSESSMENT_TASKS[DAYS UNTIL DUE] = "14 DAYS OR LESS",
                ASSESSMENT_TASKS[Days Until Due] = "15 TO 45 DAYS"
            )
        )
    

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.