Dynamic rows controlled by slicers - to be possible or not to be possible?

Pivvv

New Member
Joined
Aug 25, 2014
Messages
10
Below you can see 2 very basic Power Pivot tables:
The first table is a disconnected table with 1 column "Category" wich contains only 2 values:
  • Products
  • Subproducts
This column is used as a slicer to filter on "products" or "subproducts".

The other table is a very basic Salestable which contains the sales by products and subproducts.



Here's what I can't achieve:

In the screenshot below I select "Products" in the slicer. What happens is that the pivottable shows sales by Product:

20h2z9.jpg



Now I select "Subproducts" in the slicer and what I want to happen is this:
The rows have to show sales by subproducts instead of product.
Obviously, what I did here is changing the rowlabel from "Product" to "Subproduct" but the real question is this:
Is it possible to create a rowlabel (calculated column) that changes the values of that column by the selection of the slicer?
I want the rows to show OR the products OR the subproducts, based on the slicerselection.

9glbph.jpg


I started out with creating a measure to catch the slicer selection but even after thinking and trying for several hours, I still didn't make any progress from there. Is it simply impossible or is there a way out?
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hmmm....

It feels vaguely possible (you could certainly have a measure that returned the text associated with product/sub-product description, based on the slice selection), but... I don't get what you would put "On Rows" of your pivot.

I really think you might have a better time going with Cube Formulas here?
 
Upvote 0
I do not really see the use case for that but if you really need it this way you could try the following. Create 2 Sum of Sales measures, one that ignores the subtotals and one that only shows the subtotals and than use a 3rd measure to switch between those measures depending on the slicer selcetion. In rows you would need products and subproducts


formula could be something like
sumproducts =if(countrows(values(Table1[Subproduct]))>1,sum(Table1[Sales]),blank())
sumsubproducts = if(countrows(values(Table1[Subproduct]))=1,sum(Table1[Sales]),blank())
 
Upvote 0
Thank you all so much for the replies.
At this moment I've used the technique last mentioned. This is realy amazing! I'm hoping to learn much more of this.
 
Upvote 0

Forum statistics

Threads
1,224,041
Messages
6,176,026
Members
452,697
Latest member
CuriousSpreadsheet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top