?
Solved

How to display percentage on an SSRS Report

Posted on 2014-02-06
10
Medium Priority
?
7,565 Views
Last Modified: 2014-02-13
I have a row group and for each row I display a count and then display a total for the group in the group footer. I'd like to display the percentage next to the count but I am not sure how to create it. Any help is appreciated.
0
Comment
Question by:J C
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
10 Comments
 
LVL 12

Assisted Solution

by:Tony303
Tony303 earned 800 total points
ID: 39840735
Hi,

Here is a wee example I have made.
You are dealing with rows, which is slightly diffrent but the key I think is to reference your denominator as the Text box value.

You'll get the idea.

T
SSRS.docx
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 1200 total points
ID: 39841124
You can use the Sum() function to calculate the percentage.  This function has several implementations, the one you're after takes two parameters: what to sum and the scope.

Here's what the expression would look like:

=Fields!YourCount.Value / Sum(Fields!YourCount.Value, "YourRowGroup")

Open in new window

This assumes that your count is a field in the dataset.  If it's a calculation in the tablix then you'll want to replace the first parameter in the Sum() call with that calculation.  Note that the Count/CountDistinct/CountRows functions also accept scope.

The expression would become something like:

=ReportItems!YourCountTextbox.Value / Sum(<some Count expr>, "YourRowGroup")

Open in new window

Ow, to format the percentage you can put a P in the Format property of the textbox.  That's just one method, there are several as this article explains: Formatting Numbers [SSRS]
0
 

Author Comment

by:J C
ID: 39842348
Thank you guys for your help so far, I am having issues and I am sure it's user error but here is what I've got.

Here is my expression

=Count(Fields!question.Value) / Sum(Count(Fields!question.Value), "table1_banswer")

Open in new window


"Warning      1      [rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox21.Paragraphs[0].TextRuns[0]’ contains an error: Input string was not in a correct format.      C:\Users\Liz and Josh\Documents\Visual Studio 2008\Projects\WC Reports\WC Reports\Buyer Profile Summary By Project.rdl      0      0      "

It returns a value of 1 for every row.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 12

Expert Comment

by:Tony303
ID: 39842858
0
 
LVL 12

Expert Comment

by:Tony303
ID: 39843018
So did you get it going in the end?
0
 

Author Comment

by:J C
ID: 39843039
Yeah I was grabbing the sum from the wrong group. I was dividing the count by the sum of the same value. Brain freeze on my part. Once I grabbed the sum of the correct group it all worked as expected. Thanks for your help.
0
 
LVL 12

Expert Comment

by:Tony303
ID: 39843162
Cool,

PS. it is customary to give a few points to everyone who helped positively with the question. I know Valentino is the undisputed king of SSRS, and his answer was the best, but a hundred points here and there makes all the difference to mere mortals.

Cheers now, go well, have fun.

T
0
 

Author Comment

by:J C
ID: 39843208
Tony,

I usually do that but it's been a long week. I'll see if they'll let me redistribute some to you. I appreciate your response and it was leading me in the right direction. Sorry for that.

Thanks
0
 
LVL 12

Expert Comment

by:Tony303
ID: 39843773
Don't panic, I'll live. keep smiling.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question