Calculate percentage in Excel pivot table - excel

I have an Excel table with country, ID & group columns.
I created a pivot table with countries in rows, groups in columns and
the values are count of ID's in each country/group.
I wish to add to the pivot percentage columns for each group.
It should display the percentage of the total in the source table.
If I hide some groups/countries then the total percentage will not be 100%.
I tried to add calculated field in which I divide the count of ID's to total ID's
but it did not work.
How can I do it ?
Thank you
Example File

Related

How to count the number repeated product purchased by the same customer based on

I have a table with
customer identifier (email)
order number (1 refers to the first order one has placed, 2 is the 2nd)
SKU is the product identifier.
I want to see a table that has two columns:
SKU
the number of times this product has been showed in both the 1st and 2nd order of the same customer. Or in other words, how many times the product has been ordered repeatedly.
Something like this:
What excel function could achieve this?
You can achieve this with a helper column using COUNTIFS, and then a pivot table:
Helper column formula:
=--(COUNTIFS(A$2:A2,A2,C$2:C2,C2)>1)
Add a value filter to the pivot table to only show rows with a value greater than 0.
You can also create a Power Pivot table to count distinct orders and create a measure to count repeat orders.
Here, column F is the Distinct count of customer and column G is the total count of customer for each SKU. Columns H and I are measures you can create with power pivot.

Pivot Table Sum Items, But Average Grand Total

I have a Standard Pivot Table it has Date from the Columns and Numbers in the Value,
Column: Date | Numbers
I want the Numbers in the Rows to be Calculated as Sum, but I want the Grand Total to Average those Sums Rows
How is this possible?
Assuming you have PowerPivot, which you should if you have 2016, and assuming a table called Table1 loaded into the data model, you can add a measure for the sum, called say TotalNumber, which is just:
=SUM(Table1[Numbers])
Then add another measure which is the one you'll use in the pivot table:
=IF(HASONEVALUE(Table1[Date]),[TotalNumber],averagex(VALUES(Table1[Date]),Table1[TotalNumber]))

% of Row Total in pivot table

I'm trying to format my pivot table values as percentages of their row totals (in my data, each quarter). However, when I select Show Values as % of Row Total, it gives each value 100%.
When I try Show Values as % of Parent Row Total, it uses the column as the total and uses the first 4 quarters of 2017 as % total of 2018, not at all what I want to do.
Here is my current pivot table
Here is how I'm trying to format the same pivot table
I didn't type all your "types" (or whatever is in the columns), but when I summarize by % of Row Total, it works as expected.
Is yours set up differently than what I show?
Update
If your data points are all separate columns as #jeffreyweir suggests, then you can't summarize them how you want using pivot table features. You'll have to add some columns to your data
Each Pct column is a formula:
=[#Replacement]/SUM(tbldata[#[Replacement]:[DTK]])
=[#Refund]/SUM(tbldata[#[Replacement]:[DTK]])
=[#Parts]/SUM(tbldata[#[Replacement]:[DTK]])
=[#DTK]/SUM(tbldata[#[Replacement]:[DTK]])
Then you can sum those in a pivot table.

Excel - trying to identify top 3 sales numbers in column d, and return information from corresponding column a

Excel - trying to identify top 3 sales numbers in column D (D5:D:41), and return information from corresponding column A (A5:A41)
You can get the top 3 with
=INDEX($A$5:$A$41,MATCH(LARGE($D$5:$D$41,ROW(A1)),$D$5:$D$41,0))
Copy down two rows.
You could use a pivot table to very easily get his information.
Select insert a pivot table
Select your data
In the pivot table window place the 'Name' field into the 'Row Labels' box and the 'Sales' field into the 'Values' box.
This should give you a pivot table with a list of people and the sum of their sales, making it very easy to see who comes out top.

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