I am currently creating a dashboard type list of products sold with multiple measures, example below. There are a total of 104 products.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Total Sold[/TD]
[TD]Total Sale $[/TD]
[TD]Total Returned[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bike[/TD]
[TD]50[/TD]
[TD]$5000[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Car[/TD]
[TD]30[/TD]
[TD]$12000[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
Due to needing to filter this by Customer as well, I am using cube formulas instead of a normal PivotTable. We have 20k+ customers and 100k+ contacts within the customer list and need to be able to enter a customer number or contact name into a drop down and get the table to update, and drop downs and cube formulas are easier for my users than a 20k button slicer.
So when my user enters a customer number, the table for customer 1 looks like this
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Total Sold[/TD]
[TD]Total Sale $[/TD]
[TD]Total Returned[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bike[/TD]
[TD]6[/TD]
[TD]$800[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Car[/TD]
[TD]8[/TD]
[TD]$1400[/TD]
[TD]0[/TD]
[/TR]
</tbody>
[/TABLE]
All this is working great.
My problem is coming when I try to create sort options for the table. I have a slicer from a disconnected table that gives all the sort options (Total Sold, Total Sale $,Total Returned) and a formula in A3 as follows:
=IF(CUBERANKEDMEMBER("PowerPivot Data",Slicer_Sort_By,1)="All","Total Sold",CUBERANKEDMEMBER("PowerPivot Data",Slicer_Sort_By,1))
So A3 returns the sort slicer selection or returns Total Sold as default if nothing is selected.
In A1 I have a cubset formula as follows:
=CUBESET("PowerPivot Data","[Products].[Product ID].children","Products Cubeset",2,"[Measures].["&$A$3&"]")
and down Row B is my Product IDs with the following formula spanning 104 rows
=CUBERANKEDMEMBER("PowerPivot Data",$A$1,ROW(A1))
When I use my Sort by Slicer to select a sort, it sorts, but it sorts by totals, not by totals for the selected customer, so once sorted by total sold, the second table above will still have bike first as it is the highest selling total item, even though customer 1 bought more cars.
I have the customer number returned in A4, so I think if its possible I just need to add something to the last argument of the cubset function to make it look like
=CUBESET("PowerPivot Data","[Products].[Product ID].children","Products Cubeset",2,("[Customers].[CustomerID].["&$A$4&"],[Measures].["&$A$3&"]"))
but I've tried this and many other variations and can't get anything but N/A errors.
Anybody know if its possible to sort by multiple paramaters/levels like this and if so if I am on the right track or how I would do it?
There will ultimately be 2 cells and 4 slicers that I will want the sort to comply with, but once I have the syntax right I'm sure I can figure out the rest.
Thanks and Happy New Year
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Total Sold[/TD]
[TD]Total Sale $[/TD]
[TD]Total Returned[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bike[/TD]
[TD]50[/TD]
[TD]$5000[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Car[/TD]
[TD]30[/TD]
[TD]$12000[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
Due to needing to filter this by Customer as well, I am using cube formulas instead of a normal PivotTable. We have 20k+ customers and 100k+ contacts within the customer list and need to be able to enter a customer number or contact name into a drop down and get the table to update, and drop downs and cube formulas are easier for my users than a 20k button slicer.
So when my user enters a customer number, the table for customer 1 looks like this
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Total Sold[/TD]
[TD]Total Sale $[/TD]
[TD]Total Returned[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bike[/TD]
[TD]6[/TD]
[TD]$800[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Car[/TD]
[TD]8[/TD]
[TD]$1400[/TD]
[TD]0[/TD]
[/TR]
</tbody>
[/TABLE]
All this is working great.
My problem is coming when I try to create sort options for the table. I have a slicer from a disconnected table that gives all the sort options (Total Sold, Total Sale $,Total Returned) and a formula in A3 as follows:
=IF(CUBERANKEDMEMBER("PowerPivot Data",Slicer_Sort_By,1)="All","Total Sold",CUBERANKEDMEMBER("PowerPivot Data",Slicer_Sort_By,1))
So A3 returns the sort slicer selection or returns Total Sold as default if nothing is selected.
In A1 I have a cubset formula as follows:
=CUBESET("PowerPivot Data","[Products].[Product ID].children","Products Cubeset",2,"[Measures].["&$A$3&"]")
and down Row B is my Product IDs with the following formula spanning 104 rows
=CUBERANKEDMEMBER("PowerPivot Data",$A$1,ROW(A1))
When I use my Sort by Slicer to select a sort, it sorts, but it sorts by totals, not by totals for the selected customer, so once sorted by total sold, the second table above will still have bike first as it is the highest selling total item, even though customer 1 bought more cars.
I have the customer number returned in A4, so I think if its possible I just need to add something to the last argument of the cubset function to make it look like
=CUBESET("PowerPivot Data","[Products].[Product ID].children","Products Cubeset",2,("[Customers].[CustomerID].["&$A$4&"],[Measures].["&$A$3&"]"))
but I've tried this and many other variations and can't get anything but N/A errors.
Anybody know if its possible to sort by multiple paramaters/levels like this and if so if I am on the right track or how I would do it?
There will ultimately be 2 cells and 4 slicers that I will want the sort to comply with, but once I have the syntax right I'm sure I can figure out the rest.
Thanks and Happy New Year