Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

How to do Number Formatting for Visual Calculations

Is there a way to do a number formatting for visual calculations?

 

It seems to follow the original measure, but when I do a divide to get a % of Total I want to present a percentage. Currently that doesn't seem possible. See below example:

  • I have two measures,
    • [Sales Amount] formatted as currency
    • [Sales Amount (Fmt % 1dp)] with same amount, formatted as percentage.
    • Visual Calculations:
      • Cumulative Sales = RUNNINGSUM([Sales Amount])
      • % of Final Number = DIVIDE(RUNNINGSUM([Sales Amount (Fmt % 1dp)], ROWS), COLLAPSEALL([Sales Amount (Fmt % 1dp)], ROWS))

 

As you can see the tooltips no longer carry the original formatting. Is there a way to customize the formatting? FORMAT does not work here as it returns a text value which cannot be displayed on the chart. 

 

10 Replies

  • It appears this is now possible to do via the visual Properties → Data Format → Apply Settings to, and choose the visual calculation field. Documentation is here.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous 

     

    Idrissshatila , thanks for your concern about this case.

     

    Do you want the points on each line to show their respective values? I did the following test using sample data, hope it helps.

     

    I created two measurements and a visual calculation just to reproduce the steps you did.

     

    two measures:

     

    sum = CALCULATE(SUM(financials[Profit]), ALLEXCEPT(financials, financials[Country]))
    total = CALCULATE(SUM(financials[Profit]), ALL(financials)) 

     

     

    Visual Calculations:

     

    Then I turned on the Data labels option.

     

    Result:

     

    Best Regards,
    Yulia Xu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I think you missed the point of the question. You haven't shown how to format the number as a percentage.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous 

         

        After my testing, Tooltip is not able to customize the format.

         

        The following ways are for your reference.

         

         

         

         

        Result:

         

        Best Regards,
        Yulia Xu

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • I was able to get this to work by formatting the original data label as a percentage and then adding the calculation.  You have to add the custom format before inserting the calculation.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reply. We have tested it and it works for displaying on the line chart, but it does not affect the tooltip. The main objective is to have the tooltip display with the number formatting we need so this is not resolved yet.