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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

DAX syntax error (Beginner)

Hello,

the following DAX code renders a syntax error;

Cond1=IF('Total Sales Norden Details'[Förs. YTD]>'Total Sales Norden Details'[Tot. Förs. föreg. år],1,0)

 

The syntax error is:

 

DAXerror.PNG

Any help would be appreciated.

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

That is the correct DAX syntax, I recreated it exactly. Are you entering this in the data model or in Power Query? Because Power Query uses "M" language, not DAX. The error you are showing looks like it is coming from Power Query, not the data model.

 

In "M", it would be:

 

Cond1=if [Förs. YTD] > [Tot. Förs. föreg. år] then 1 else 0


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello and thank you for your help. I am entering it in the data model. Can it have something to do with the special characters in the column names?

I thought of that too, but it worked perfectly for me. The only thing I didn't replicate exactly was the table name, mine was called "Table4". Unless it is a difference between the language versions. What gets me is that red x, timestamp and weird "Query(1, 32)", I don't typically see that, can you post a larger screen shot that shows the context? Generally, when I mess up a DAX equation, I see something like:

 

daxerror.png



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

My mistake, I try to create the DAX in DAX studio and when I try to run it, that is when I get that error message.

 

And if I put in the same code in BI Desktop to create a measure,  I get this error message;

DaxError2.PNG

 

Sorry for the confusion...

@Anonymous

 

If you want to create a calculated column in Power BI Desktop.

Please try to replace ; with ,

Or replace , with ;

They should be consistent.

 

DAX syntax error (Beginner)_1.jpg

 

Best Regards,

Herbert

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors