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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KL001
Frequent Visitor

DAX syntax error introduced on data load

I had previously been loading a small subset of data into my model to carry out calculations. I could refresh the data without any issues. Upon bringing in a larger subset of the data into the model I get the following error:

KL001_0-1648241134337.png

I found the column with the corresponding code and commented it out, but received the same error.  I then deleted the column entirely, and yet I still get this error when attempting to load the data. Why is this happening?

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

yes, your DAX code is likely missing a VAR statement. Please post the full code. 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

yes, your DAX code is likely missing a VAR statement. Please post the full code. 

It turns out there was a measure floating around within the same table that contained similar code as my calculated column. I must have started to create it on accident as a measure and never removed it after the column was created. I'm still not sure why it didn't present a problem with previous data refreshes. Here is the code, it looks like I just removed the name at some point leaving a rouge return statement:

Var DaysOverdue = today() - Documents[periodic_review_due_date]

Return

SWITCH(
TRUE(),
DaysOverdue <= 30 && DaysOverdue >= 1, "0 to 30",
DaysOverdue <= 60 && DaysOverdue >= 31, "31 to 60",
DaysOverdue <= 90 && DaysOverdue >= 61, "61 to 90",
DaysOverdue >= 91, "X > 90",
BLANK()
 
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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