PivotTable showing the Top 5 Sales Representatives per Month - excel

I have an Excel data that shows the Sales of each of the Sales Reps. So I want to see the total for each rep per month which is easily doable with a PivotTable. Now I want the Pivot Table to only show the Top 5 per month so say I have 2 months in the coverage, I will see 10 names in total.
The Top filter in Pivot Tables computes for the Top for the entire data set and not for each category. Or am I missing something? Is it possible?
Thanks a lot for your responses.

You can make a measure if you connect your data to the datemodel and use PowerPivot
Rigth click on table to add Measure
That will enable you to use DAX i Excel (used in Power BI) And by using DAX you can make a top 5 per categori
inspiration: https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

Related

Need to add VAR % Column for 2022 vs 2021 numbers, it also needs to be included in the Grand Total bar at the bottom

Report Picture
I am trying to add a Column at the end of this pivot table that will show VAR % 2022 vs 2021. I will also need the calculation to occur in the Grand Total bar at the bottom so we can see the VAR % by account, plus by Grand Total. This report is generated using Power Pivot so I cannot use the Calculated Field option. I attempted to create a Measures in the Power Pivot, but what happens when I add that Measure to my Pivot Table is it ignores all Slicers/Filters and shows every single account in the Data Table when the filtered drill down should only be about 30 accounts.
Any idea on how I can achieve this? I would love to use Measures so I can also attach a KPI but for some reason using Measures makes it like I didn't even have a filter working.
Any help or insight is greatly appreciated.

Calculate average based on a value column (count) in a pivot table

I'm looking a way to add an extra column in a pivot table that that averages the sum of the count for the months ("Count of records" column) within a time period that is selected (currently 2016 - one month, 2017 - full year, 2018 - 5 month). Every month would have the same number based on the year average, needs to be dynamically changing when selecting different period: full year or for example 4 months. I need the column within the pivot table, so it could be used for a future pivot chart.
I can't simply use average as all my records appear only once and I use Count to aggregate those numbers ("Count of records" column).
My current data looks like this:
The final result should look like this:
I assume that it somehow can be done with the help of "calculated filed" option but I couldn't make it work now.
Greatly appreciate any help!
Using the DataModel (built in to Excel 2013 and later) you can write really cool formulas inside PivotTables called Measures that can do this kind of thing. Take the example below:
As you can see, the Cust Count & Average field gives a count of transactions by month but also gives the average of those monthly readings for the subtotal lines (i.e. the 2017 Total and 2018 Total lines) using the below DAX formula:
=AVERAGEX(SUMMARIZE(Table1,[Customer (Month)],"x",COUNTA(Table1[Customer])),[x])
That just says "Summarize this table by count of the customer field by month, call the resulting summarization field 'x', and then give me the average of that field x".
Because DAX measures are executed within the context of the PivotTable, you get the count that you want for months, and you get the average that you want for the yearly subtotals.
Hard to explain, but demonstrates that DAX can certainly do this for you.
See my answer at the following link for an example of how to add data to the DataModel and how to subsequently write measures:
Using the Excel SMALL function with filtering criteria AND ignoring zeros
I also recommend grabbing yourself a book called Supercharge Excel when you learn to write DAX by Matt Allington, and perhaps even taking his awesome online course, because it covers this kind of thing very well, and will save you significant head-scratching compared to going it alone.

Filtering top 10 elements in pivot table does not show expected rows

I am using the excel's pivot table to sort and filter data from Super Store Dataset from tableau . Here is a screen shot of my output.
The steps that I followed are:
a. Put Order Date in the Rows.
b. Put Sub-Category in the Columns.
c. Put the Profit in the Sum of Values.
After that I took these steps:
d. Sort the Grand Total of the Sub Category from largest to smallest.
e. Sort the Grand Total of Order Date from largest to smallest.
f. Filter Top 3 from the Sub-Category.
g. Filter Top 10 from the Order Date.
And the above image of an excel sheet shows my output.
Now the problem is , even though the excel sheet was supposed to show me the top 10 orders , it only manages to show 7 to 8 orders. The rest 2 to 3 of them are either blank or should not even belong to the top 10 category.
Does anybody knows why is this happening. And how can this be prevented.
Thanks.
Edit: This is how the top 15 looks like :
I believe top 10 is based on the vertical Grand Total and it should also be a subset of the top 15.
And this is the top 20 :
It looks like this is caused by opening the .xls workbook in Compatibility Mode. This means that Version 10 pivot tables are created, which have different filtering functionality to the later, Version 12 Pivot Tables.
Change the workbook to an upgraded file format (.xlsx), and refresh your pivot tables - you'll get an interesting message informing you of the changes made to Top 10 filtering, and then the multiple Top N filters will apply correctly:
Here's some more information about Pivot Table versions / compatibility, from Microsoft

Weighted average price of a product per day in Pivot Table

I am having issues translating the following formula to a pivot table; either through a regular pivot table, or through DAX and powerpivot.
=SUMPRODUCT((C$2:C$11)*(D$2:D$11)*(A$2:A$11=A2)*(B$2:B$11=B2))/SUMIFS(D$2:D$11,A$2:A$11,A2,B$2:B$11,B2)
The background is, I have a number of products that appear on an e-commerce site, and I need to find out their price per day. However, these prices change daily, based on things like promo codes, visitor location etc. Therefore, I need their weighted price based on the number of visitors that saw a particular price.
Can anyone help with this translation, or alternatively, offer a better way to approach this problem?
PS- I need it in a pivot table due to the volume of data. At 250,000 rows, standard Excel cannot handle this formula.
The following is in Excel 2010 sans Powerpivot. However, the general approach should work:
Explanation:
I added a column that multiplies the Prices and Visits. The pivot table uses Dates, then Product SKU as the row labels. Then I added a calculated field that divides the Price*Visits by the Visits.

Getting only top 10 values from an Pivot table

I have created some pivot tables which shows sales of PC from different brands for multiple years. for example 2013 PC sales of dell,HP,Apple etc...
Now I want to compare these sales but I just want to compare top 10 results...I am trying to create a table which will show only the top ten values from the pivot table. I dont want to filter the pivot table to top 10 values.
Thanks and Regards
If you have to create your output as a table without filtering the pivot table, you can use cube functions. Create a cubeset that is all PC brands and order them by PC Sales. Create cubrankedmember functions for positions 1 through 10. Then write a cubevalue formula next to each cuberankedmember to retrieve the associated value. If you want to post a little more about your data model, I could write more specific cube function formulas.

Resources