Multiple pivots in Excel - excel

I am working with Excel and have a pivot table like so:
[ Gender, pivot ]
Year > Quarter Male Female
[-] 2014 64% 36%
Q1 60% 40%
Q2 70% 30%
Q3 60% 40%
Q4 60% 40%
This would have what I call two two row-aggregations (Year, Quarter) and one column-aggregation or pivot (Gender). Is there a way to have multiple pivots, for example having it with one row-aggregation (Year) and two column-aggregations (Quarter, Gender)
Year [Quarter > Gender ]
Q1 Q2 Q3 Q4
M | F M | F M | F M | F
2014 60 | 40 70 | 30 60 | 40 60 | 40
If this is not possible, are there other tools that would allow me to do multiple pivots? Is this a common use case in data-analysis, having multiple pivots?

Sure, Move the Quarter into the "Column labels" box (above values)

In addition to user3240704's post, when you group the dates, the smallest unit you choose in the grouping dialog will be showing with the original column name. If you group by Year, Quarter and Month on a column called "MyDate", you will see Year, Quarter and "MyDate" in the field list and can drag "Quarter" to the column labels as described. If your grouping is only on Year and Quarter, you will not see a "Quarter" field and will need to drag the "MyDate" field into the column labels field well.
In the screenshot, my date field is called "date" and grouped by Year and Quarter.

Related

Apply growth % to range in Excel

I'm doing a sales forecast and want to project what a 10% growth would be from month 1 to month 24.
For example if month 1 = 100 and a 10% growth for month 24 = 110.
The spreadsheet is laid out like this:
B C D Y
2 Month 1 Month 2 Month 3 ... Month 24
3 100 110
What function would I use to populate columns C3 though X3? say
Thanks!

Running-Total for multiple Measures

Appreciate if anyone could advice how can I apply the Running-Total function for multiple measures?
I have 2 measures (Count) and (Revenue) by Month (Row) and Year (Column)
Product A Product B
2014 2015 2014 2015
Count | Revenue Count | Revenue Count | Revenue Count | Revenue
Jan 100
Feb 200
YTD 300
Mar 555
YTD 855
I tried with
running-total (currentMeasure for [Month], [Year], [Product Type])
but there is error claims that currentMeasure is not supported for QueryPackage.
In case I interpreted the message wrong, appreciate for your advice how can I apply the running-total correctly for multiple measures.
Thank you.
Count
running-total([Count] for [Product Type],[Year])
Revenue
running-total([Revenue] for [Product Type],[Year])
You don't specify month because it is in the row header. The 'for' clause indicates the grouping and the grouping comes from the column headers while the month defines the row grain. Another way to think about it is to put it into English:
Within each Product Type and Year combination, show me the accumulating total of each succeeding row broken out by Month.
Also, currentMeasure is used only in dimensionally-sourced reports, I believe.

How to select/filter rows in MS Excel based on cell value

I'm working on an excel sheet which has a simple structure like this.
Date | Order
-----------------------
08-15-2014 | 84
08-16-2014 | 50
08-17-2014 | 68
08-17-2014 | 78
08-18-2014 | 23
Here, in a separate column I'd like to calculate the sum of Orders by week days(Sunday, Monday and so on). Meaning, I want to see how many Orders received on Sunday, Monday etc.
So far I have come up with this non working formula.
=SUM(LOOKUP(1, WEEKDAY(date_column), order_column))
This was example for summing all order received on Sunday. And, yes Date column is in DateTime Data type so that shouldn't be a problem.
Thanks.
Consider adding a new column after the dates, representing the day values. So in column B you might have something like =TEXT(WEEKDAY(A2),"ddd").
Then if you wanted to sum up order numbers by day, you could use an equation like =SUMIF(B1:B5,"Sun",C1:C5) where column B has the day values and column C has the order numbers.
To show an example (with headers, etc):

Add entire calender year to pivotTable in Excel from sample with only few dated entries

Hopefully somebody can help me figure out a better way to create what I need in a pivotTable. I have a table structured as follows:
Date | ID# | Revenue
---------------------------------------
1/1/14 | 123 | $200.00
1/1/14 | 234 | $99.00
1/5/14 | 455 | $100.00
1/31/14 | 5666 | $50.00
2/4/14 | 2454 | $500.00
...
...
...
12/4/14 | 88484 | $3000.00
Unfortunately, when I create a pivotTable off of this information, and then try to process the data all the way into chart data, it gives me only dated entries when there is an actual entry.
What I need is to not only create a table that shows dates that had $0.00 revenue, but also a chart that displays all 365 days, without manually going back day by day (as there are 1000+ rows) to enter a day that has a $0.00 revenue.
Any ideas?
One approach would be to put the days of the year into a spare column, say D, by starting with 1/1/14 in D2, pulling down with the right mouse button and choosing 'Fill Days'.
Then put a formula into column E starting in E2 like
=SUMIF(A:A,D2,C:C)
to put in the total revenue for each day in column C based on all matching days in column A.
that's assuming that what you want is the total revenue for each day of the year whether or not it's zero.

Custom Formula for Grand Total column

I have a frequent problem where the formula I want to use in the Values area in my Pivot-Table is different than the formula I want to use for the Grand Total column of that row. I typically want to Sum the Values but I want to average the Sums. Here is what I normally would get if I pivoted the dates on the Column Labels, Meat Type on the Row Labels, and Sum Orders in the Values.
Row Lables | Day 1 | Day 2 | Day 3 | Grand Total
________________________________________________
Beef | 100 | 105 | 102 | 307
Chicken | 200 | 201 | 202 | 603
I get sums by day and a sum of all of the days in the Grand Total column. Here is what I want to have:
Row Lables | Day 1 | Day 2 | Day 3 | Grand Total (Avg of Day Totals)
________________________________________________
Beef | 100 | 105 | 102 | 102.3
Chicken | 200 | 201 | 202 | 201.0
In this case the Orders are still summed by day but the Grand Total is now an average of the sums. What I do now is copy and paste the Pivot data onto a seperate sheet then calculate the averages. If there was a way to do this with a custom Grand Total column it would be incredible. This is one of the biggest shortcomings of Pivot Tables for me but I'm hoping it is due to my ignorance, which it often is. Thanks for the help!
You can write a measure that checks the number of 'rows' in a particular filter context and nest that in an IF() to determine which to use.
If using PowerPivot V2 then it's:
=IF(HASONEVALUE(Calendar[Day]), SUM(AMOUNT), AVERAGE(AMOUNT))
If using PowerPivot V1 it's:
=IF(COUNTROWS(Calendar[Day])=1, SUM(AMOUNT), AVERAGE(AMOUNT))
Both do the same thing in that they assess the number of rows in the table in the given context and when the Meat Type is 'Beef' then the temporarily filtered table has one row. If it doesn't have one row then its going down the path of the AVERAGE()
This assumes your column headers 'Days' are in a table called Calendar (if you aren't using a separate Calendar table then you are missing the most powerful functionality of PowerPivot IMO).
Jacob
I can't think of a "good" way, but here's one option. Add the Amount field to the data area a second time and change the operation to Average. Then use conditional formatting to hide the averages in the data area and hide the sums in the total area.
You might be better off just using some array formulas in a do-it-yourelf pivot table. You lose the pivot table benefits, but get more flexibility with the data.

Resources