Forum Discussion

carrot6981's avatar
carrot6981
Frequent Visitor
1 year ago
Solved

DAX measure get syntax error when save file

Hello. I am using PBI Desktop Version: 2.138.1452.0 64-bit (November 2024).

When I hit enter, the measure works fine.

But when I saved file, the measure get syntax error.

I hit enter again, measure fine again, but still error when saving.

Hope for your help. tks
This is the link file:
https://drive.google.com/file/d/1qlIZHCQCkEDqgbYoZ4KNFDU6kaBJHFOk/view?usp=sharing 

This is the video demonstration error:
https://drive.google.com/file/d/1Hg1r1hDdZnCD6kCBMIwiwaXhaUaWPXyM/view?usp=sharing

  • hi OwenAuger 
    thanks for your hint.


    In my location, decimal separator always is comma, and group separator is dot, so this is my setting on PC. That's right when my decimal and list separator is same. That was the problem.

    Then I change the list separator on Regional setting to semi colon, and use it for setting on PBI, and it worked.
    Tks for save my day.

     



5 Replies

    • carrot6981's avatar
      carrot6981
      Frequent Visitor

      tks @ danextian but the origin on formula is comma not dot.

      you can see the video above

       

    • OwenAuger's avatar
      OwenAuger
      Super User

      Hi carrot6981 

      I'm assuming under your Windows regional settings that the decimal separator and list separator are both "," (comma). Is that correct?

       

      It appears that Power BI Desktop can get confused when a comma is "ambiguous", in that it can be interpreted as either a decimal or a list separator, in this case the comma following the 1. It appears to interpret the comma as a list separator when the expression is first entered, then re-interpret it as a decimal separator when saving (and convert it to ".").

       

      I was able to replicate your issue with these steps:

      1. Sett my Windows decimal separator and list separator to comma in Control Panel > Region > Additional Settings
      2. Open Power BI Desktop and check that Options > Global > Regional Settings > DAX Separators is set to "Use localized DAX separators".
      3. Close Power BI Desktop
      4. Open your PBIX
      5. Save your PBIX

       

       

       

       

      Recommended solution:

      1. I recommend changing the Power BI Desktop DAX separators setting in screenshot above to "Use standard DAX separators" to avoid this whole issue (restart after changing this setting).

      This would require you to use "." as decimal separator and "," as list separator in all DAX expressions.

      2. Alternatively, you could leave this setting unchanged and remove ambiguity by inserting white space between any numbers followed by list separators.

      e.g. Change this

       

      1,

       

      to this

       

       

      1 ,​

       

      This would be a bit awkward in practice, so I recommend the first solution.

       

      Does this help at your end?

       

      • carrot6981's avatar
        carrot6981
        Frequent Visitor

        hi OwenAuger 
        thanks for your hint.


        In my location, decimal separator always is comma, and group separator is dot, so this is my setting on PC. That's right when my decimal and list separator is same. That was the problem.

        Then I change the list separator on Regional setting to semi colon, and use it for setting on PBI, and it worked.
        Tks for save my day.