Frosa
Frosa

Reputation: 37

Calculate percentage on SSRS Expressions

I have the following table on SQL:

Category  |   Requests
Cat1      |   150
Cat2      |   200
Cat3      |   550
Cat4      |   100
Cat5      |   50
SUM       |   1050

How can create an expression to calculate the percentage of Cat5 compared to the total? (4.7% in this case).

Upvotes: 0

Views: 12683

Answers (2)

alejandro zuleta
alejandro zuleta

Reputation: 14108

Try this:

=Lookup("Cat5",Fields!Category.Value,Fields!Requests.Value,"DataSetName")/
Sum(Fields!Requests.Value,"DataSetName")

Replace "DataSetName" by the actual name of your dataset.

Upvotes: 3

Fuzzy
Fuzzy

Reputation: 3810

Assuming you want 150 to represent 150% within the rdl you can do the following:

first apply the following formula: =Fields!field.Value/100

Where Fields!field.Value is the field you want to convert to percentage so if your field is called Requests then you will have =Fields!Requests.Value/100

enter image description here

Then you need to change the type of the textbox to be percentage from the TextboxProperties

enter image description here

you should get a result like this:

enter image description here

Upvotes: 1

Related Questions