Pivot Table Issue - Grouping three fields (columns) into one - excel

I have three fields in my pivot table. Each field is connected to one column in my data sheet.
The goal is to group the 0-30 data (0-30 $ Change),and (0-30 % Change) into one field, and then a slicer with 0-30 as one of the options out of 60-90, 90-120.
Currently I have a combined Pivot Table that looks like this:
Again the goal is to make one slicer that would have the 0-30 data as one option in the slicer, the 30-60 data as one option in the slicer and so on...any help would be appreciated :)

With PIVOT functionality and some formulas my approach would be to concatenate 0-30 data with 0-30 $ Change and 0-30 % Change in one column in the source and then present it in the pivot ROWs area. Here is how it looks wiht some sample data:
The second image is how the modified source looks like with the formulas used in the top row with yellow ready to be copied down:
If questions, please do let me know.

Are you looking to 'switch out' the values fields depending on what someone selects in the Slicer? If so, check out my answer at Converting multiple variables into values with excel pivot tables or power pivot
Basically, youreate a new PivotTable from a data source that contains nothing but the options that you want to show up in the slicer. i.e. '0-30', '30-60' etc. Create a slicer for that PivotTable, and when a user clicks on it, catch the resulting PivotTable_Update event and use it to change which fields shows up in your existing master PivotTable.
See the other thread for more on how to do this.

Related

Pivot Table sorting - category instead of "Values"

Below is the extract of a table i want to sort
I'd like to create two Pivot Table in two separate sheets so that I only have the start and end Dates corresponding to only one of the two categories, i.e AC156 or AC157
Extract of the result tables
Since the source list keeps getting updated, I'd really like to do this using Pivot Tables so that I can keep refreshing it.
It seems simple enough but I'm admittedly quite new to Pivot Tables. Any help would be appreciated.
Highlight your data table;
Insert a pivot table;
Put all three columns into Rows field;
Right click somewhere within the pivot table, go to PivotTable Options, go to Display, select Classic PivotTable layout (enables dragging of fields in the grid);
If your pivot table has grouped the dates by month, un-check Months2 in the data fields but leave Months if you want to sort by Start date;
If you pivot table has shown the subtotal for start date, right click the subtotal row and deselect Subtotal 'Start'.
You can make a copy of the pivot table, filter the Cat, sort the Months and then Start, then you should have:

Get slicer selection of a data table

I have been struggling with this issue in the past days and haven't found yet any solution.
I have a simple table (not a pivot table) and some slicers attached to it. I want to 'simply' show selected value/values of the slicer in a cell. It implies of course to make the cell update automatically according to the selection.
Some of the solutions I found suggested using two pivot tables, one main for the regular data and the other hidden to capture the selected filters. The problem is that I am not working with a pivot table, but rather a simple table.
I also tried getting distinct values of the table column, but I couldn't perform it properly without getting the hidden values of the filtered table too.
Is there any way in Excel to do this simply?
Thank you!
You can follow the below steps to achieve your result
You will have to insert a serial number column in your table
After that insert the below formula above the header or anywhere you want to display the selected value
The formula in C2 is
=INDEX(Table1[Data 2],SUBTOTAL(5,Table1[S.No]))

Add column to Excel Power Pivot Table based on slicer seection

I have an Excel Power Pivot Data Model with one table of about 3m entries. In one of my sheets I have multiple slicers that I combine to select entries that fit specific criteria.
I would like to add a column with a value that comes from a cell in the sheet, but only when the entry was part of the selection. For example: when the value in the cell is 1, the selected entries will get "1" in the added column. After that the number in the cell could be set to 2 and a new selection could be made. The new selection will all have "2" in the same added column.
I have been trying to make this work running a macro and DAX, but it can't get it to work. Anyone any ideas?
You can use the VBA I've previously posted at Converting multiple variables into values with excel pivot tables or power pivot to do that. It requires you to make up a 'harvester' PivotTable containing just the columns you want to swap out, so that you can then create a slicer from which to trigger the code.
You can also write a conditional formula in DAX that uses a harvester measure. Something like https://powerpivotpro.com/2012/11/one-slicer-to-control-them-all/ (and plenty of other examples on Google)

Combining Column Values in an Excel Pivot Table

In order to simplify a stacked bar chart, I am looking to sum up the counts of multiple columns I have in my pivot table. For example, in this sample table, I would like to combine Fruits and Vegetables into one column, so that each bar will comprised of three colors: one for Meats, one for Grains, and one for Fruits+Vegetables.
Pivot Table and Stacked Chart
For reference, this is the data source:
Data Source table
I tried adding a Calculated Field, but I'm not sure if I can use specific values from a column in the Formulas field. Is there a way to create something like this from a pivot table, or should I be taking a different approach to this all together?
I'm using Excel 2016, -- pretty sure it's the same with older versions, but the premise is the same.
In your pivot table, Select the Pivot Table Tools> Analyze tab, then "Fields, Items",then pull down to"Calculated fields". Enter a name for the generated field, and the formula you want to use:
In my example, I added the fields Fruit and Vegi's from my available pivot table fields (which is based on my data table).
Then select the calculated field as you would any other..
and create the chart as usual.
Hope this helps.

Excel: Pivot Table Filtering Using VBA/Slicer?

Gold star for whoever solves this! :)
I have a pivot table that has data from various attributes attached to unique ID numbers from an OLAP cube report. When I select ID# as a pivot field and all the corresponding attributes ie: Name,age,etc I end up getting about 10k ID's with 10k corresponding attribute values. I have a list of 3k ID#'s which I want to filter my report by. What is the best way to do this?
Simple example: Pivot table displays ID# 1,2,3,4,5 and corresponding attributes such as name,age,etc
I want to filter ID#'s from a column of values I have in another worksheet for example the column in other worksheet would have ID#'s 1,2,3 (Which in theory would omit values 4 and 5 from pivot)
(Keep in mind I am dealing with thousands of rows this example is made simple just for explanation)
I thought a VBA slicer combo might work, but I have no clue how to set up a slicer so when it is created it has only values selected from a column of values.
In my example VBA slicer will have ID#'s 1,2,3 selected upon creation or an easy way to select multiple ID#s from a list or something as I can't feasibly click through 3k values
Possible Solutions I Brainstormed
I was also thinking maybe just a VLOOKUP or something that will pull ID#'s against the column and also bring all corresponding attributes? The thing is I like the cube report being dynamic and updating with the slicer.
I then also thought to create a slicer based off of another pivot table which is composed simply of a header of ID#'s and lists ID# 1,2,3 I created in another worksheet and try and use that simple slicer against the OLAP cube, but the issue is the slicers have different connections and they can't overlap. :(
Any and all help is much appreciated!!! :)

Resources