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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Samiullah-Ehsan
New Member

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 2019 as ''2019''.
=CALCULATE([Net_sales],dim_date[FY]=''2019'')

The expression is not valid or appears to be incomplete. Please review and correct the expression.
The syntax for '2019' is incorrect. (DAX(
CALCULATE([Net_sales],dim_date[FY]=''2019'')

)).

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

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.

View solution in original post

2 REPLIES 2
123abc
Community Champion
Community Champion

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.

Thank you for the detailed answer and solution. It is working with this solution now. I got it fixed earlier with the help of ChatGPT, I copied the DAX syntax from there and it was the same syntax that I had written, and then pasted it in pivot measure and it worked.
However, then I deleted the measure and created it again, and again it was returning error despite the rught syntax, I again copied the syntax from ChatGPT and it worked. Don't know why it accepts the same copied DAX syntax from ChatGPT and returns the value and when I enter the DAX syntax while creating measure it returns error and shows red line under 2019 after entering single or double quotes.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.