Pivot Table Sum Items, But Average Grand Total - excel

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]))

Related

subtract two column pivot table using calculated value

I need to find the average of profit by subtracting ( average budget from average revenue ) , both these two column calculated by pivot table
I tried to input this in the calculated field: =AVERAGE('Box Office Revenue ($)')-AVERAGE('Budget ($)')
and then summarized field value to Average but still show summation.
i don't need to subtract the summation of these two column but i need to subtract the averages.
Can you please support in that.

Calculate percentage in Excel pivot table

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

% 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.

Left outer join sum with DAX

I have 2 tables:
Fact sales table (sales)
Dimensional period table (dimperiod)
I have joined them through my model on the Period column. However, when I display the sales sum I got this.
I would like to have a row where no sales were made with a sum equal to 0. As below:
I've used the following DAX but didn't work.
CustomSales:=CALCULATE(SUM([Sales]), NATURALLEFTOUTERJOIN(sales,dimperiod))
Just change the pivot table to display blanks.
Or add 0 to your measure. Pivot tables do not display blanks by default. The first option above forces the pivot to display blanks, but you'd need to set this per pivot table. Addition implicitly coerces a blank to a numeric type.
SumSales:=
SUM( 'Sales'[Sales] ) + 0

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