Forum Discussion
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:
Any help would be appreciated.
5 Replies
- Greg_DecklerCommunity 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
- AnonymousNot 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?
- Greg_DecklerCommunity Champion
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: