How to do Average in SSRS
Hello, Prod Name ListPrice Standard Cost Average ________________________________________________________________ Book 96 78 Shirt 760 700 Laptop 10000 9900 Helmet 650 600 I need to average under the "Average" column, could please let me know the expression. Thanks in advance.
April 26th, 2011 5:07am

If you only got two columns you could use =(reportitems!listprice.value+reportitems!standardcost.value)/2
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 5:09am

Hi, There is AVG() function for calulating average. But, Can you plase add some details for for which fields you want to average? Some more detail for dataset will help in understanding the problem better.- Chintak (My Blog)
April 26th, 2011 5:12am

Hello Chintak, I need "Standard Cost' and "List Price" average value in the "Äverage" column ( Row Average). Moreover if there is 10 columns like "Standard Cost' and "List Price", etc..., what is the expression to get Average value.My Dataset name is "DataSet1". Guys, could please please provide me suitable solutions for my other posts ( "How to do Group totals and Group Average in the Matrix", and "How to format the data in the Matrix"). many thanks in advance.
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 5:29am

Hi Reddy, If Columns are fixed then I would prefer to do Average in Database Stored Procedure and just display on report.So if any column is added/removed, we can change it from SP only. Thanks,Tejas Shah SQL YOGA
April 26th, 2011 7:02am

Is that possible to do that via T-SQL?Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 7:13am

Hi Dimant, Yes we can do it easily as follows: SELECT (Column1 + Column2 + Column3) / 3 --as I used three columns. Isn't it? Thanks,Tejas Shah SQL YOGA
April 26th, 2011 7:17am

If you only got two columns you could use =(reportitems!listprice.value+reportitems!standardcost.value)/2
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 12:07pm

yes you are right.. select (([Column1] + [Column2] + [Column3])/3) as Average from table
April 27th, 2011 2:13am

There are two ways you can do his. 1) With in the reprot. in you Average Coulmn do as below =(Fields!LastPrice.Value + Fields!StandardCost.Value)/2 2) You can write a query in SQL SELECT [Prod Name], SUM(ListPrice), SUM([Standard Cost]), SUM(ListPrice + [Standard Cost])/2 AS Average FROM TableName GROUP BY [Prod Name] in your reprot create a dataset and drag and drop the Average column into Average Textbox. I hope this should help to solve your probelm. All the bestDasari
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2011 2:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics