Rounding Percentages and Numbers, adding a second row in legend so it displays two lines per box


https://www.nevron.com/Forum/Topic9497.aspx
Print Topic | Close Window

By Steve Murray - 5 Years Ago
Below is a sample of my chart.  I would like to round the number values (with a comma) and no decimals.  On the percentage, I would like zero decimals.  See chart below.

https://www.nevron.com/forum/uploads/images/c39c36c1-e943-491a-9397-eae4.png
By Nevron Support - 5 Years Ago
Hello Steve,
You can achieve your requirement like this:
1. In the Data Labels tab, Format filed, leave only: <label>
2. In the General tab, Data -> Label field, use an expression like:
=FIRST(Fields!LABEL.Value) + " - " + SUM(Fields!VALUE.Value) + " - " + FORMAT((SUM(Fields!VALUE.Value)/SUM(Parent.Fields!VALUE.Value)), "P0", "en-us")

Hopefully this helps.
By Steve Murray - 5 Years Ago
Formatting of the number worked! No decimals now, but I still do not display "," (comma) separator for the thousands. Below is my format:  =FORMAT(SUM(Fields!Total_Current_Charges),"N0")

By Nevron Support - 5 Years Ago
Steve, your expression for the format looks ok. However, this may be related to the culture which is used.
If culture is not specified in your expression, the default current culture is used.

You can take a look at the help documentation:
Pivot Engine > Functions > Text Functions
Resources > Numeric Format Strings
Resources > Culture Table

You can update your expression like this:
=FORMAT(SUM(Fields!Total_Current_Charges), “N0”, “en-US”)

or if you prefer to use custom numeric formatting:
=FORMAT(SUM(Fields!Total_Current_Charges), “##,#”, “en-US”)