calculating proportion of sales in powerpivot - excel

I have a powerpivot table that looks like this:
Product, Units_sold, Year
A 10 1990
A 5 1990
B 12 1900
C 50 1900
I want to create a calculated field for the contribution to overall sales of each sale, e.g. in this case divide every number by 77.
How can I do that in Powerpivot?

Use this formula for your calculated column:
=[Units_Sold]/SUM([Units_sold])
Rename your column and choose formatting from the Home menu.

Related

Calculation weekly quantities based on monthly data

I have been struggling to solve an issue to calculate monthly packages sales based on purchases during defined weekly time ranges. I have the following sample data:
Original Data :
The sales quantities are for two products A and B combined. A buyer X purchases 5 B packages on the first week of every month, another 4 on week 6 then 4 packages every 10 weeks.
I added the highlighted columns to the original table. I tried the following but the calculation I made in column E seems to be the sum of sales for B packages from the actual month until the end of the year rather than only for the current month. The formula I used in cell D2: '=(C2-6)/10', i.e. calculating how many 10-week ranges during the year after deducting 6 weeks. The formula I used in cell E2: '=5+4+4*D2', i.e. 5 is the initial quantity in week 1, 4 is the quantity in week 6 then 4 times the amount of 10-week ranges.
Calculation :
Is there a way, or a formula to calculate the monthly sales quantity for product B only?
I design from scracth the table to reflect the model I have understand:
Column D is for sales the first week of the month, column E is for sale on week 10 and column F is for sales every 10 weeks.
Formulas are spanish but are easy:
mes stands for month
si stands for if
residuo stands for residual
suma stands for add
It's quite complex and there are many many criterion when we try convert weekly sales in monthly sales. My criterion was every day of a week computes to the month of the Monday of that week.
I hope have met your requirements.

how to get cumulative amount of columns under certain criteria when skipping some of them

I have a question with regards to getting the cumulative amount of some columns when skipping others (please see the picture).
Lets say on a certain row we have certain type of op units for which we have 3 columns for every month (Revenue, COS, G&A). We have this for Jan, Feb, March and then 3 columns to total the amounts for quarter 1. The next 3 columns are for April.
My question is how to make formulas that can add the cumulative amount for year to date in each category while skipping the Q1 amounts. I can do with offset but I can't skip Q1 column.
You need a SUMIFS formulas that sum amounts in columns B:P for each category but exclude amounts where B1:P1 = "q1". So for YTD Revenue the formula would be:
=SUMIFS($B$3:$P$3,$B$2:$P$2,Q$2,$B$1:$P$1,"<>q1")
Copy to the right into columns R:S and then down rows as required.
Sorry, I don't think that offset /sumif will work because of 3 different criteria.
Otherwise the month I will be selecting in row 1 after end of the table (after Dec17 and Q4) there will be 3 foxed columns that will show YTD cumulative figure which should change when the month changes

creating a calculated field in excel pivot table based on an item in a column

Normally calculated pivot table fields in excel (2010) you click:
design tab > options and sets > calculated field
and if you had three columns: name, sales, cost
name | sales | cost
josh 10 2
your calculated field might be: profit which would be: = sales - cost.
However is it possible to make a calculated field which calculates the difference between two items in the one "Week Ending" column?
For example "Week ending" contains a dates which end on a friday 2015-05-01,2015-05-08,2015-05-15 etc and they are in the column labels section of the pivot table.
The "week ending" dates are all in the one column, is it still possible to calculate the difference between two of them with a calculated field?
name | End Fri 2015-05-01 | End Fri 2015-05-08 | calculated (Delta)
josh 8 10 10-8 = 2
You do this with a Calculated Item. Here is an example that I think gets close to what you want. I selected one of the dates in order to get the menu to show up.
Here is the result
And here is a good reference about these. http://www.contextures.com/excelpivottablecalculateditem.htm

Excel: Trailing 3 month decline using data from a pivot table

(http://stackoverflow.com/questions/5283466/calculate-moving-average-in-excel seems to be somewhat related. I'm curious to know the non-vba way to do this.)
My my pivot table has source data that creates a count of how many sales a person had in the past 36 days. Each day os 1 column in the pivot table, and the persons name is on the row.
Some of these people did not have sales on day1, day2, etc, and may only have 3 days where they sold something on days 14,15 and 16. No matter what their sequence, I want to to find the most recent sale data (closest to the right edge of pivot table) and calculate three sales increases e.g. C20/C19 will be >1 if they had more sales on the whatever day C20 is. The increase ca nbe fond by subtracting 1 and changing to percent. The problem is, if a person only had sales on d10, d11, d12 then how can I put a general formula in Excel to say "look for the most recent consecutive sales, then calculate this ratio"? For a person who had sales in the past three days, that's easy. It will be chaotic to hardcode where to look for each sales value.
d1 d2 d3 d4...d7 d8 d9...d34 d35 d36 mostrecentincrease nextrecent
ant 1 5 7 7/5=1.4 5/1=5
bat ...10 11 12... 12/11=1.blah 11/10=1.1
cat 2 6 9 13
dog 19 20 20/19=1.blah 19/blank=0
elf 4 4/dnexist=0
i don't have excel here, but i hope this will guide you to the correct result (use , instead of ; if that is your list separator):
define sales as a range of values from d1 to d36 for a given row (or use actual ranges)
compute positions of the last values for each row using these array formulas (use ctrl+shift+enter instead of just enter after you write these formulas):
position_1 =max(if(sales<>0;column(sales)))
position_2 =max(if((sales<>0)*(column(sales)<>position_1);column(sales)))
position_3 =max(if((sales<>0)*(column(sales)<>position_1)*(column(sales)<>position_2);column(sales)))
retrieve the values:
value_1 =index(sales;position_1)
do some error handling (=iferror(...;0)) and the like...

Issue with Excel Pivot Table Subtotals / Row Hierarchy

I currently have a pivot table with three row labels. The data in the row labels is grouped as follows:
Customer SKU Grouping YTD PrevYTD
123 ABC Qty 30 20
Sales 500 400
DEG Qty 100 150
Sales 1,000 2,000
The YTD and PrevYTD are columns and the values.
I can do a custom subtotal on the 'Grouping' field and choose Sum and it gives me the totals at the end of the report:
Qty Sum 130 170
Sales Sum 1,500 2.400
This is good to this point, but I also want to have subtotals by customer. What I want to see is the same breakdown under each customer (a total of Qty and a total of Sales) but I cannot get this subtotal to work. When I put a subtotal on the Customer field, it puts a oneline subtotal and is adding the Qty and the Sales together. In this example if I put a subtotal on Customer This is what it will display:
123 Total 1630 2570
Is this possible to do what I am looking for?
Thanks for the help!
How about making Grouping a column label instead? It will change the layout somewhat but will allow you to get the effect you are after.
To do this you need to use a second pivot table. It's easier to do it with the tables side-by-side, but you can do it with a table underneath by just deleting the second table and inserting a new pivot table after the last row of the first each time the first table is changed.

Resources