I have a sheet with sales for a couple of months, and I'd like to have a chart show me the sales of months and how the price change per unit has affected its sales. So in other words a typical price/value chart. There's a caveat, though, I don't have the explicit data of when the price change has taken effect, I'm determining it from how much the customer paid per unit.
For your info, here's the steps I did to create the chart I have now (using Excel 2013):
So I went to the Field Settings and checked "Show items with no data".
Now we have another problem: the table/chart shows all dates of the entire year, I don't even have the data for the entire year. So for this I have the "Months" filter handy and I choose a specific month I'd like to analyze. (Bug alert: if you check "Select Multiple Items" in the bottom of the filter menu, the entire table/chart still shows, but the data is only for the checked month(s).)
The problem here is, that since I don't have explicit data on when unit prices changed, and I only determine it from sales, I have a bunch of blank rows in the table for days that had no sales, causing odd spikes in the chart (see image: https://www.dropbox.com/s/7dh61hke7fk8g4j/Odd Spikes.JPG, the orange line is the price per unit, the blue is the quantity sold).
I assume the best way to fill in the blank is somehow through a Calculated Field. And here's where I'm stuck. I started writing an IF statement, as follows:
The questions marks is where I'd like to reference "the previous populated row in this column", so the price line will stay put till there's a sale with a change of "Price per Unit" to it.
Is this a possibility? If not, is there a different/better way to achieve the desired results?
For your info, here's the steps I did to create the chart I have now (using Excel 2013):
- Created a pivot table
- Added "Date" in the Rows section
- Added "Quantity" and "Price per Unit" in the Values section, setting them to Sum and Average respectively
- Added "Item Number" in the Filters section
- Group Fielded "Date" as "Days" and "Months", and moved the auto generated "Months" from the Rows to the Filters section
- Created a pivot chart with chart type as Combo, and set the "Average of Price per Unit" as a secondary axis
So I went to the Field Settings and checked "Show items with no data".
Now we have another problem: the table/chart shows all dates of the entire year, I don't even have the data for the entire year. So for this I have the "Months" filter handy and I choose a specific month I'd like to analyze. (Bug alert: if you check "Select Multiple Items" in the bottom of the filter menu, the entire table/chart still shows, but the data is only for the checked month(s).)
The problem here is, that since I don't have explicit data on when unit prices changed, and I only determine it from sales, I have a bunch of blank rows in the table for days that had no sales, causing odd spikes in the chart (see image: https://www.dropbox.com/s/7dh61hke7fk8g4j/Odd Spikes.JPG, the orange line is the price per unit, the blue is the quantity sold).
I assume the best way to fill in the blank is somehow through a Calculated Field. And here's where I'm stuck. I started writing an IF statement, as follows:
Code:
=IF('product sales'=0, ?? ,'product sales'/quantity)
The questions marks is where I'd like to reference "the previous populated row in this column", so the price line will stay put till there's a sale with a change of "Price per Unit" to it.
Is this a possibility? If not, is there a different/better way to achieve the desired results?