Forum Discussion

RobRayborn's avatar
RobRayborn
Helper IV
10 months ago
Solved

Format string showing negative sign (-), sometimes.

I'm using calculation groups and one is to show the growth % form previous year. I'm using the following Fromat String to format this calculation group: VAR Output =IF( SELECTEDMEASURE() >= 0, FORMA...
  • OwenAuger's avatar
    10 months ago

    Hi RobRayborn 

    First off, to fix the issue I would suggest this format string which should give you the intended format:

    "0%;" & UNICHAR ( 128315 ) & "(0%);0%"

    To explain the issue:

    1. In general, a format string expression should return the format string itself, not the formatted measure value as text. (In some cases it can be useful to do this but is not needed here).
    2. If you did want to return a literal formatted value, you would need to return """" & Output """"
    3. SELECTEDMEASURE () is a reference to the underlying measure used in the visual, which is not the Growth % returned by this calculation item's expression but is rather the original measure for which you are calculating Growth %. So the logic is not correct for testing the sign of the Growth % value.

     

     

  • RobRayborn's avatar
    10 months ago

    Thank you. That worked perfectly.