Pivot Table Display - Full order information if it contains one particular item

devlynsyde

New Member
Joined
Sep 23, 2009
Messages
23
I am trying to do something that seems like it would be standard, but I can't find anything through searching possibly because I can't figure out proper wording for what I want to do.

I have a table full of orders, and I want the pivot to display only those orders that contain a specific item, but show all items in that order.So for example if someone purchased a t-shirt, jeans, and pair of socks I want it to show:

Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]Invoice 3382[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]              T-Shirt[/COLOR][/SIZE][SIZE=3][COLOR=#000000]         1[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]              Jeans[/COLOR][/SIZE][SIZE=3][COLOR=#000000]           8[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]              Socks[/COLOR][/SIZE][SIZE=3][COLOR=#000000]           1[/COLOR][/SIZE][/FONT]

But a typical filter would only display the invoice and the t-shirt.Is it possible to do this with power pivot or vba?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
So, if you had a column in your pivot table... say:

TshirtCount := CALCULATE(COUNTROWS(Invoices), Invoices[ProductId] = "TShirtId")

Add it in the values portion of your pivot table. Then you could use the UI to do a VALUE FILTER on Tshirtcount > 0.

You could then just hide the TShirtCount column out of your pivot and dance?
 
Upvote 0
So, if you had a column in your pivot table... say:

TshirtCount := CALCULATE(COUNTROWS(Invoices), Invoices[ProductId] = "TShirtId")

Add it in the values portion of your pivot table. Then you could use the UI to do a VALUE FILTER on Tshirtcount > 0.

You could then just hide the TShirtCount column out of your pivot and dance?

This does the same thing as filtering on the specific Item. The formula puts a 1 on any row where the ProductId is in the example TShirt, but not on the other rows of the invoice. So the filter would only show the TShirt in the pivot.

Code:
    Invoice             Product              Cost
    1383                Jeans                 4.00
    1383                TShirt                2.00
    1334                TShirt                 2.00

So if the above is a simple representation of the data, I want it to display all of this in the pivot. If it has to be a formula like this I could some what live with it, but ideally I wanted to be able to do this on more than one item.
 
Upvote 0
I did try this out before posting, and it worked fine for me. My filter was at the Transaction level, so the whole transaction was included/excluded, not individual items.
 
Upvote 0
I did try this out before posting, and it worked fine for me. My filter was at the Transaction level, so the whole transaction was included/excluded, not individual items.

Ahh.. I was applying the filter incorrectly. This works for a specific item, but now is it possible to feed the DAX a variable item?
 
Upvote 0
Depending on what you want to do... Shouldn't be a problem. Say, filter on a column called "MustBeIncluded" ?
 
Upvote 0
Depending on what you want to do... Shouldn't be a problem. Say, filter on a column called "MustBeIncluded" ?

Ideally to pick an item or type an item code and have MUSTBEINCLUDED do the formula you provided for the item code typed in the standard Excel, instead of just for jeans.
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,869
Members
452,679
Latest member
darryl47nopra

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