MicrosoftDocs / feedback

📢 docs.microsoft.com site feedback
https://learn.microsoft.com
Creative Commons Attribution 4.0 International
239 stars 160 forks source link

Example for dynamic format strings not working #2179

Closed isjaguti closed 4 years ago

isjaguti commented 4 years ago

Link to article: https://docs.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups#dynamic-format-strings

Problem: I tried to implement the percent format string as described here for the measure "YOY%" by setting the format string expression property in my tabular model to "0.00%;-0.00%;0.00%". This can be done by just cutting and pasting the string from the documentation. Without the double quotes, I get the error message: "Calculation item 'Time Intelligence[Delta PY PCT]': The following syntax error occurred during parsing: Invalid token, Line 1, Offset 6, %." Using double quotes around the expression I don't get an error, but the format string does not work at all (no percent calculation, no different format).

Maybe this is because I work with german regional settings, where we use the comma instead of the dot as a numeric separator, but still: this example should work...

welcome[bot] commented 4 years ago

Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).

mlottner commented 4 years ago

@isjaguti Thanks for taking the time to give us site feedback. I've assigned your issue to the content owner for awareness and direction about the correct method for direct service feedback and support.

ghost commented 4 years ago

@isjaguti - In your problem statement, you state "Without the double brackets," and "Using double brackets around the expression" Do you mean double quotes?

isjaguti commented 4 years ago

Absolutely, @Minewiskan , I meant double quotes! This is not my native tongue, so I got a little lost.

ghost commented 4 years ago

@isjaguti - Assuming you are working in Visual Studio, are you using a localized German version of VS?
What version of Visual Studio are you using? You can check this in Help>About Visual Studio What version of the Microsoft Analysis Services Project extension is installed? You can check this in Extensions>Manage Extensions. If your VS and projects extension are up to date, this is likely a bug. The code as described in the article appears to be correct.

ghost commented 4 years ago

in-progress

isjaguti commented 4 years ago

@Minewiskan - Yes, I am using the localized German version of Visual Studio, Version 16.3.10. Analysis Services Projects is version number 2.9.3., which is apparently up to date. If this is a bug, it might be helpful to look at the XMLA code that gets created when I deploy this calculation item, WITH double quotes around it: { "name": "Delta PY PCT", "expression": [ "DIVIDE(", " CALCULATE( SELECTEDMEASURE(), 'Time Intelligence'[Time Calculation]=\"Delta PY\"),", " CALCULATE( SELECTEDMEASURE(), 'Time Intelligence'[Time Calculation]=\"PY\" ) ", ")" ], "formatStringDefinition": { "expression": "\"0.00 %;-0.00 %;0.00 %\"" } } As mentioned above, this has no effect to the calculation. When I remove the "backslash double quotes" part in the beginning and the end of the format string and try to create the model from XMLA, I get the same error message as in my initial post.

ghost commented 4 years ago

@isjaguti - We're investigating this and will get back to you once we know more.

ghost commented 4 years ago

Unable to reproduce. No other issues reported.

please-close