Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Selective Average in SQL 2008 r2 report builder
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

12 Posts

Posted - 11/23/2012 :  06:24:26  Show Profile  Reply with Quote
Hi all

SQL 2008 R2 Report Builder

I'll keep this simple.

Imagine I have a dataset that relates to sales.

The data set at row level has a year and month.

In the report I group by year and month.

At the year level I have an expression which shows the average sales per month for the year. An expression which sums up total sales for the year divided by distinct count of amount of months there are the in current dataset SUM(sales)/DISTINCT COUNT of Months.

This works fine.

I've now been asked at year level for an average of the last 6 months. So if we had say 11 months details at month level Jan - Nov then at Year level there would be an average of Jan - Jun sales.

Any idea on how to do this? The requesters come from Excel and they say it is easy lol, select Jan - Jun date range and choose AVG in the sum area.


  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000