Forum Discussion

Samiullah-Ehsan's avatar
Samiullah-Ehsan
New Member
2 years ago
Solved

DAX CALCULATE expression error

I am creating a new measure (Net_sales 2019), but as I am entering the DAX measure it shows red line under ''2019'' and returns an expression error. FY is a text column that is why I have entered 201...
  • 123abc's avatar
    2 years ago

    The error you're encountering is because you are using double quotes ('') to enclose the year '2019' within your DAX expression, which is causing a syntax error. In DAX, you should use single quotes (') to enclose text values. Here's the corrected expression:

     

    =CALCULATE([Net_sales], dim_date[FY] = "2019")

     

    In this corrected expression, '2019' is enclosed in double quotes, which is the correct way to specify a text value in DAX. Make sure your column [FY] in the dim_date table also contains '2019' as a text value for this expression to work correctly.

     

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

     

    In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.