Wednesday 29 January 2014

SSRS: Computed column from DataSet and format the number to percentage with 2 decimal point

Scenario:
I have a DataSet created from SQL Procedure. I want to add a computed column that will calculate percentage using two other column from the DataSet.

Solution:
In order to add computed column:

  1. Select the DataSet and Right click
  2. Select Add Calculated Field
    • Give a Field Label. 
    • In the Field Value, click expression and type:=FORMAT((Fields!ID.Value/SUM(Fields!ID.Value)), "P")





Format a number like 95.1264892 to 95.12:
=Format(Fields!myField.Value,"##.##')

Format a number like percentage:
=FORMAT((Fields!ID.Value/SUM(Fields!ID.Value)), "P")

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home