I am having problem to calculating % on base of subtotal value in Matrix in SSRS Report - sql-server-2005

I am having problem to calculate the % value on the base of subtotal per each row and in the column.
As you may see from the snap shot# 1, I am unable to calculate the percentage value basing upon the sub-total value (i.e. from the 1st row).
And this is how i want to show my output as shown below snapshot.

I found the answer for the above question calculating the percentage based on the subtotal for inscope values.
=FormatPercent(Sum(Fields!StartingInventory.Value)/Fields!Sum_StartingInventory.Value,1)

Related

powerpivot 2016 - Divide summed value column with grouped raw value

I’ve got about 1 million records to perform the following calculation, which I was not very successful so far. I appreciate if you could point me to the right direction.
What I’m trying to do is write measures or calculated fields to:
divide the summed field from a value in the grouped raw.
Get the quotient
Get the mod
Calculate price
Display the grand total at the bottom
Example file: https://1drv.ms/x/s!AkN0kHWepnYzgSujfvGKA15fEygW
Appreciate your help

Calculate matrix of values based on column and row totals

I have data that is broken into group totals (rows) and month totals (columns). I need to take the totals and calculate a value for each month within each group. From my screen shot I can find an monthly cell value for the quarter total with the formula
=INT($F3/3); this would ensure that all rows total correctly but does not address the requirement for all columns to total correctly.
For the screen shot I manually added the values to visualize the desired outcome
Group Calculation: (Jan+Feb+Mar)=Q1 group total
Month Calculation: (Group1...Group6)+Inventory = Monthly Total
In the "current result" screen shot the values total correctly by groups however the result is incorrect by month. For example 'Jan' totals to 159.
Current Result
I'm looking for assistance in a formula or vba that would allow the monthly values to total to the group and month total.
Desired Result
It sounds like you are looking to recreate a matrix from the totals of its rows and columns.
First, you need to remove the Inventory totals from the column totals, as those figures do not need to be calculated.
Then, you can get quite close to the answer with the formula =ROUND(RowTotal*ColumnTotal/OverallTotal,0). In this case, the formula in cell B2 would be =ROUND((B$8*$E2)/$E$8,0)
However, since there is rounding involved, you will notice that the values do not add up perfectly. For a matrix this small, your best bet would be to manually fix the problem values. To do so, add formulas to check which columns and rows are improperly totaled. Your check formulas should subtract the totals of each row and column from the desired row and column total. This reveals that cell B3 is the problem, as both column B and row 3 are misaligned.
You can change cell B3 to 48, which will then ensure that all columns and rows total properly. If you had a much larger matrix to solve, you could write some VBA code to automate the check of each column and row.

Single aggregate column / running value sum on chart

We're currently porting some excel reports to SSRS. One of those reports has a graph where the last column is the MTD (Month to date) average for both series (Availability and Availability Goal) just like the example below:
I did some research about RunningValue() but whenever I did it it would add a second bar to my graph (the running value would have the same group).
Is it possible to have only one aggregate column (just like the screenshot) ?
Thanks in advance,
One way would be to force the average through the SQL query. For example, if your resulting table shows days of the month, and the Availability value, you could UNION a "dummy" day (max days of the month + 1) with the averaged value. You can either add an addition column to your SQL for the label names, i.e. the "dummy" day would show "Average", or in SSRS you can change the Label expression to replace the last value with a text.

SSRS Reporting Services calculating 2 sums if parameter is true

I have a simple income and covers served per day report, I need to calculate the variance % difference between this years income and last years income, but excluding any sites that opened this year.
I have the following expression however the results it returns are way out from what I am expecting:
=sum(iif(Fields!New_Site.Value=False And Fields!netSalesLY.Value<>0,CDbl(Fields!netSalesTY.Value/Fields!netSalesLY.Value),CDbl(0)))
New_Site is a Boolean parameter to filter out new/old sites, and both netsalesTY and netsalesLY are integer values.
Any ideas?
Thanks
The first thing I notice is that you're not referencing the New_Site parameter, you're referencing the New_Site field in your formula. If you wanted to reference the New_Site parameter, you would do it as
Parameters!New_Site.value
Not sure which you are really wanting to use.
Also, I may be misunderstanding what number you're trying to calculate, but if I understand you correctly, you're using the wrong formula. You're not using the percent difference formula, which will return the percent of this years sales related to last years sales, not a difference between the two. If what you want to know is the percent difference between the two years, it would be calculated as:
(Fields!netSalesTY.Value - Fields!netSalesLY.Value) / Fields!netSalesLY.Value
So if last year your netSales were $100,000 and this year they are $85,000, your current formula would return 85%, whereas the formula I just mentioned would return -15%, thus showing the decline in sales. So with the formula I gave you, a negative number would represent a decrease from last year to this year and a positive number would represent an increase from last year to this year.
Hope this helps!

How do I compute an average of calculated averages in MS reportviewer/rdlc?

I've searched here and elsewhere on the web and have not found this exact problem/solution.
I'm building an rdlc report using the MS reportViewer - the report I'm creating is based on an existing spreadsheet where the average price across 6 months is calculated individually for each month, then the average of those prices is calculated as the 6 month period average price. Whether I agree with that methodology or if it's correct is irrelevant, I just need to know how to get an rdlc to do this.
For example:
Month Price1 Price2 Delta
May-12 $31.54 $30.03 $1.51
Jun-12 $36.27 $34.60 $1.67
Jul-12 $44.19 $42.00 $2.19
Aug-12 $38.96 $37.06 $1.90
Sep-12 $36.89 $35.08 $1.81
Oct-12 $35.57 $33.97 $1.60
Average $37.24 $35.46 $1.78
(sorry for the lack of a screen snip, I'm new and the system won't let me post an image...)
I've created a tablix that does the monthly averages computation - I use a group in the table to group the 6 months of data by month (and then hide the hourly price data so you only see the month total row) but I'm stuck on how to calculate the bottom row of the table which is the average of each column. (the average of the averages is not the same as the average of all 6 months of prices from the underlying data - that's what I've learned in this process... IOW, that was my first solution :-) )
What I tried to do to get the average of the averages was give the month total cell a name, MonthlyAvgPrice1, then in the bottom row, used this expression:
Avg(reportitems!MonthlyAvgPrice1.Value)
As I kind of expected, this didn't work, when I try to run the report, it gets a build error saying "The Value expression for the textrun 'Price1PeriodAvg.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers."
Hopfully I've explained this well, does anyone know how to do this?
Thanks!
-JayG
Actually it is not clear from the question that how are you in particular binding the data to the report items, But from the given information what I understand is that you can
Try like this:
Right Click the tablix row and insert a row below
In the cell where you want to have this Average of Averages insert the following expression
=Sum(Fields!Price1.Value)/6
and similarly insert expression =Sum(Fields!Price2.Value)/6 and =Sum(Fields!Delta.Value)/6 in the other cells where you want to display the Averages
Of Course, you will change the Field names Price1,Price2 etc to the fields that you are getting the values from.
HTH