Pivot creating nonexistent lines

msciblo

New Member
Joined
Jul 30, 2012
Messages
1
I have three tables; Line Items, Order Lines and Order Payment Lines. I would like to create a pivot using Payment Type as a slicer [I filtered to remove Reships] and the pivot contains Order Number, Product Description, Last Name, First Name and State as Row Labels with Line Total and Shipping Total as Values. I created relationships between Line Items and Order Lines on Order Number and Line Items and Order Payment Lines on Order ID.

Here are the tables:

Line Items:

OrderNumberShip DateProduct PinProduct DescriptionUnits SoldLine TotalOrder ID
11-Jan1Apples14100
22-Jan2Bananas13200
22-Jan2Apples14200
22-Jan3Cherries12200
31-Jan3Cherries12300
43-Jan1Apples14400
55-Jan4Dates15500
68-Jan3Cherries12600
71-Jan1Apples14700
71-Jan2Bananas13700
71-Jan3Cherries12700
81-Jan3Cherries12800
81-Jan4Dates15800

<tbody>
</tbody>

Order Lines:

Last NameFirst NameStateOrder IDOrderNumberShipping Total
SmithEmmittPA10015
JonesJulioNJ20028
JohnsonChadNY30036
AndrewsJulieDE40049
JacksonAndrewPA500510
BoydBrandonWI60065
PrimeOptimusPA70074
JacksonMichaelDE80082

<tbody>
</tbody>

Order Payment Lines:

Order NumberPayment MethodOrder ID
1Credit Card100
2Credit Card200
3Credit Card300
4Check400
5Reship500
6Reship600
7Reship700
8Credit Card800

<tbody>
</tbody>

The pivot below is what my attempts have yielded, however Order Number 1 only has Line Item but the pivot shows lines for all Product Descriptions. Order Numbers 5, 6 and 7 are all reships so I would like them filtered out entirely.


Payment Method slicer [filtered to allow only Check and Credit Card]

Values
OrderNumberProduct DescriptionLast NameFirst NameStateSum of Line TotalSum of Shipping Total
1ApplesSmithEmmittPA45
1BananasSmithEmmittPA5
1CherriesSmithEmmittPA5
1DatesSmithEmmittPA5
2ApplesJonesJulioNJ48
2BananasJonesJulioNJ38
2CherriesJonesJulioNJ28
2DatesJonesJulioNJ8
3ApplesJohnsonChadNY6
3BananasJohnsonChadNY6
3CherriesJohnsonChadNY26
3DatesJohnsonChadNY6
4ApplesAndrewsJulieDE49
4BananasAndrewsJulieDE9
4CherriesAndrewsJulieDE9
4DatesAndrewsJulieDE9
5ApplesJacksonAndrewPA10
5BananasJacksonAndrewPA10
5CherriesJacksonAndrewPA10
5DatesJacksonAndrewPA10
6ApplesBoydBrandonWI5
6BananasBoydBrandonWI5
6CherriesBoydBrandonWI5
6DatesBoydBrandonWI5
7ApplesPrimeOptimusPA4
7BananasPrimeOptimusPA4
7CherriesPrimeOptimusPA4
7DatesPrimeOptimusPA4
8ApplesJacksonMichaelDE2
8BananasJacksonMichaelDE2
8CherriesJacksonMichaelDE22
8DatesJacksonMichaelDE52
Grand Total2649

<tbody>
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
[Sum of Shipping Total] is a measure that comes from a lookup table. In that case, the data will not get filtered.

I am not sure about the correct explanation, but I guess this will be something along "for every Line Item, there exists, by definition, a related Shipping Total".

In order for the filtering to work, you will have to use a measure that is based on your fact table (Line Items).

Something like this:
SUMX(LineItems, RELATED(Orders[Shipping Total]))
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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