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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
zhxj
New Member

Power BI - Syntax Error for all VAR in all .pbix files

When I tried to create a new VAR in a new measure, the DAX prompt a sytax error "The syntax for ')' is incorrect (DAX(VAR))."

The problems:

1. there is no ')' after the VAR.

2. the error occurs for any VAR I created, even in a seperate .pbix file.

3. It used to be fine, but when I saved a file with DAX equations not finished, then all the .pbix files are affected.

It seems that the parser error in one measure spread to all the .pbix files.

Does anyone solved such issue before?

  syntax errorsyntax error

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @zhxj ,

Is that the whole of your measure? If so that is incomplete. The syntax of a measure/calc column or table with variables should be something like

Name =
VAR VariableName1 = <expression>
VAR VariableName2 = <expression>
RETURN
VariableName or Expression




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @zhxj ,

Is that the whole of your measure? If so that is incomplete. The syntax of a measure/calc column or table with variables should be something like

Name =
VAR VariableName1 = <expression>
VAR VariableName2 = <expression>
RETURN
VariableName or Expression




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.