How to set the Pivot Table Layout

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,585
Office Version
  1. 365
Platform
  1. Windows
As shown in below Table. "F" has sold 2 items out of which one is defective. i.e. 50% of what he has sold is defective. How do i represent this in Pivot Table?
I am unable to figure out the Layout.

Raw Data:

Sales ExecutiveProducts SoldDefective
FXYZNO
DXYZNO
FXYZYES
CXYZYES
AXYZYES
CXYZNO
BXYZNO
BXYZNO
DXYZNO
AXYZYES
GXYZYES
GXYZNO
GXYZNO
EXYZNO

I tried as shown below, but I get it as 100% for all the Sales executives. Please suggest as I am definitely missing something.

My Pivot:

Pivot image.png
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
btw. why you have value 2 for total sold? should be there 0?
Each of the Sales Executive has sold some number of items so it cannot be zero. "Total Defectives products" can be zero though.
Secondly, I am unable to get the Calculated Field to work. Could you please assist? it gives #VALUE! error.
 
Upvote 0
Each of the Sales Executive has sold some number of items so it cannot be zero. "Total Defectives products" can be zero though.
I don't understand your logic
Yellow: both are Defective but not Sold, so why Sold is 2 in your expected table?

Sales ExecutiveProducts SoldDefective
FXYZNO
DXYZNO
FXYZYES
CXYZYES
AXYZYES
CXYZNO
BXYZNO
BXYZNO
DXYZNO
AXYZYES
GXYZYES
GXYZNO
GXYZNO
EXYZNO


pt.jpg
 
Upvote 0
Thanks for your consistent response. I highly appreciate that.

To answer your question,
This is a list of sold items, so all the items are sold. There are only 3 columns; first is the names of Sales Executives, second column is the name of the Product and the third column is the informs us if the Product that was sold was defective or not.
Therefore, there is no column which defines whether a product is sold or not. XYZ is a just a pseudo name for the product that I gave it for sampling purpose.
Out of all the sold items, the Column C shows which ones are defective and which ones are not (demonstrated by YES/NO).
So, the Pivot report is basically to notify the Sales people about the percentages of the defective products that they have been selling. So that they can check the product thoroughly before selling.
Hope this clarifies the confusion.
 
Upvote 0
This is exactly what I need. But how do I do it through a Pivot?
 
Upvote 0
with my solution you will need Power Query, Pivot Table and Calculated Field

see example

it can be done without Pivot Table but you want Pivot so there is a Pivot :)
 
Last edited:
Upvote 0
I am a newbie in Power Query. Could you send a video reference that I need to watch for Power Query guidance for this particular scenario? I opened this table in Power Query but I do not know what to do further in the Query editor.
Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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