Forum Discussion
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
- severynmAdvocate I
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.
- AnonymousNot 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 XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
I think you missed the point of the question. You haven't shown how to format the number as a percentage.
- AnonymousNot 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 XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- grnelson1797Regular Visitor
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.
- AnonymousNot 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.
- IdrissshatilaSuper User
- AnonymousNot applicable
It does not help. It uses FORMAT to do the formatting on a table which returns a text. It will make the line disappear on the chart.
- IdrissshatilaSuper User
Anonymous ,
you could check this thread, as many people shared there thoughts here
https://community.fabric.microsoft.com/t5/Desktop/Share-your-thoughts-on-visual-calculations-preview/td-p/3708834