Forum Discussion

wbarnes's avatar
wbarnes
Frequent Visitor
1 year ago
Solved

I keep getting Syntax errors, can someone help me please?

Here's my measure:  Provider ID = IF(     ISBLANK(         LOOKUPVALUE(             'Provider Lookup'[Provider ID],             'Provider Lookup'[Provider Name],             'Code Stroke DD...
  • rohit1991's avatar
    1 year ago

    Hi wbarnes ,

    In DAX, string outputs in a measure must be returned as a DAX expression, not as comments (i.e., you can’t use -- for comments inside the formula). Also, "General Number" is not a valid format string for FORMAT—use "#" or just wrap the number in FORMAT without a format string.

    Provider ID =
    VAR ProviderID = 
        LOOKUPVALUE(
            'Provider Lookup'[Provider ID],
            'Provider Lookup'[Provider Name],
            'Code Stroke DDR'[Who provided Telestroke Service]
        )
    RETURN
    IF(
        ISBLANK(ProviderID),
        "No ID",
        FORMAT(ProviderID, "")
    )