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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Syntax Checker for Calculated Column

Dear PowerBI Community

I encounter a strange issue since the September Update of PowerBI Desktop.

I have the following calculated column:

Project Status CRM =
SWITCH (
[StatusCode],
1, "Neu",
300800002, "Temporär freigegeben",
300800003, "Freigegeben",
717700000, "Finale Verrechnung",
100001, "Abgeschlossen",
717700001, "Storniert",
717700002, "Gesperrt",
4, "Blockiert",
300800000, "In Bearbeitung (Obsolet)",
"Unbekannter Status"
)

It was in place and working before. I just edited it to add one additional option (717700002, "Gesperrt").

Now its showing me a syntax error:

The syntax for '"Neu"' is incorrect. (DAX(SWITCH ( [StatusCode], 1. "Neu", 300800002. "Temporär freigegeben", 300800003. "Freigegeben", 717700000. "Finale Verrechnung", 100001. "Abgeschlossen", 717700001. "Storniert", 717700002. "Gesperrt", 4. "Blockiert", 300800000. "In Bearbeitung (Obsolet)", "Unbekannter Status"))).

Data type and Format are set to "text" and I tried deleting and recreating the column already.

Any help on this? Does anyone experience same strange issues?

Thanks in advance and best,
Phil
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Does your regional settings have comma as decimal separator? When working with numbers and having the decimals mark as comma I have encountered that if that is matching with the comma of the parameters of functions I need to add the ,0 as part of my syntax for numbers.

 

Believe that this is what is happening here. Using 300800003, or 300800003,0 is the same for the syntax not really sure why is happening currently with the September version but could be this.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 



The syntax for '"Neu"' is incorrect. (DAX(SWITCH ( [StatusCode], 1. "Neu", 300800002. "Temporär freigegeben", 300800003. "Freigegeben", 717700000. "Finale Verrechnung", 100001. "Abgeschlossen", 717700001. "Storniert", 717700002. "Gesperrt", 4. "Blockiert", 300800000. "In Bearbeitung (Obsolet)", "Unbekannter Status"))).

For your code , please change "." to "," in some places.

(SWITCH ( [StatusCode], 1, "Neu", 300800002, "Temporär freigegeben", 300800003,"Freigegeben", 717700000, "Finale Verrechnung", 100001, "Abgeschlossen", 717700001, "Storniert", 717700002, "Gesperrt", 4. "Blockiert", 300800000, "In Bearbeitung (Obsolet)", "Unbekannter Status")))

BTW, you can check your DAX code in the site.

http://www.daxformatter.com/

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

OMG

It is working when I change the code as follows:

Project Status CRM =
SWITCH (
[StatusCode],
1,, "Neu",
300800002,, "Temporär freigegeben",
300800003,, "Freigegeben",
717700000,, "Finale Verrechnung",
100001,, "Abgeschlossen",
717700001,, "Storniert",
717700002,, "Gesperrt",
4,, "Blockiert",
300800000,, "In Bearbeitung (Obsolet)",
"Unbekannter Status"
)

How does this make sense?
AlB
Community Champion
Community Champion

@Anonymous 

That's weird...

Maybe some of the support people can help @v-lid-msft , @v-lili6-msft , @v-xuding-msft 

or some of the super users @Greg_Deckler , @Zubair_Muhammad , @MFelix 

Hi @Anonymous ,

 

Does your regional settings have comma as decimal separator? When working with numbers and having the decimals mark as comma I have encountered that if that is matching with the comma of the parameters of functions I need to add the ,0 as part of my syntax for numbers.

 

Believe that this is what is happening here. Using 300800003, or 300800003,0 is the same for the syntax not really sure why is happening currently with the September version but could be this.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks MFelix

That's the explanation (altough the parameter [StatusCode] is formatted as whole number - but I guess that doesn't matter for the syntax...). I changed the Model language from German (Germany) to English (United States) and my formulas are working again without decimal character.
I have a new client and therefore a new installation of PowerBI desktop. Was most probably more related to that than to the September release.

Best,
Phil

AlB
Community Champion
Community Champion

Hi @Anonymous 

The code the error message shows has dots instead of the necessary commas after the numbers. Could that be the problem? And it complains about "Neu", which is what comes after the first dot.

 

The syntax for '"Neu"' is incorrect. (DAX(SWITCH ( [StatusCode], 1. "Neu", 300800002. "Temporär freigegeben", 300800003. "Freigegeben", 717700000. "Finale Verrechnung", 100001. "Abgeschlossen", 717700001. "Storniert", 717700002. "Gesperrt", 4. "Blockiert", 300800000. "In Bearbeitung (Obsolet)", "Unbekannter Status"))).

Anonymous
Not applicable

Thanks AIB for your fast reply!

Good hint and observation! But as you see in my code I use commas...
I tried typing them again but still the same.
Could this be related to a Locale that is set in the options?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors