Reputation: 9
I am working with report services from Visual Studio 2019 and I am making a stacked bar type chart where I need to format the values to percentage, and indeed I have been able to do it but I can not format the horizontal axis, it shows me very large numbers, I have tried in axis properties > axis range and interval, but putting an interval, maximum, etc, has not worked I am already losing my mind, I have searched many sites where the different solutions do not work for me.
I need to show in the horizontal axis values like 0, 20, 40, 60, etc... but as you can see they are too big values, is there any way to format those numbers to show me only the first two digits or something like that? I can not make a division for that because the data is varying, if someone has gone through the same please I need your help, thank you very much.
Upvotes: 0
Views: 1082
Reputation: 10870
On the Horizontal Axis properties, you can set the LabelsFormat
property in the Property pane or the Custom Format
in the Property pop-up to be dynamic based on the values.
=SWITCH(MAX(Fields!DATA.Value) > 1000000, "0,,M;(0,,)M",
MAX(Fields!DATA.Value) > 1000, "0,K;(0,)K",
1 = 1, "0,;(0,)")
This will show values in the millions as 1M, 2M, etc. while thousands would be displayed as 1K, 2K...
The expression ( MAX(Fields!DATA.Value)
) will vary based on the charts' data.
Upvotes: 1