How do I show the difference in sales each year compared to a reference year?

captdunco

New Member
Joined
Mar 15, 2016
Messages
2
Hi guys,
I am new to power pivot (Less than a week). I am trying to calculate determine the cost difference for a given product each year compared to a give n reference year. My data is as below:


ProductYearCost
A201523
A201610
A20176
A20184
A20194
B201535
B201623
B201721
B201820
B201920

<colgroup><col span="3" width="64" style="width: 48pt;"></colgroup><tbody style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; margin: 0px; outline: 0px; padding: 0px;">
</tbody>
Ideally , I want to summarize the above into a table as below showing the difference in cost in each year per product compared to 2015. Below is an illustration.
Difference in Cost per year compared to 2015
Product20152016201720182019
A0-13-17-19-19
B0-12-14-15-15

<colgroup><col span="6" width="64" style="width: 48pt;"></colgroup><tbody style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; margin: 0px; outline: 0px; padding: 0px;">
</tbody>
I have tried several measures but they all seem to give wrong figures. I am out of ideas.
I am a total newbie and am supposing this could be very easy to most of you but I would appreciate help ideas on how to go about this.
Thanks.


 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You will definitely need to build your knowledge. You should create a calendar table.
Power Pivot Calendar Tables - Excelerator BI

then the approach really depends on your data. How many rows in the data table? How many products? What granularity is your data? Is it yearly like shown? I recommend you read my book as it was designed to help you get started Learn to Write DAX - Excelerator BI. In the mean time, post the above info and I will try to help you.
 
Upvote 0
You will definitely need to build your knowledge. You should create a calendar table.
Power Pivot Calendar Tables - Excelerator BI

then the approach really depends on your data. How many rows in the data table? How many products? What granularity is your data? Is it yearly like shown? I recommend you read my book as it was designed to help you get started Learn to Write DAX - Excelerator BI. In the mean time, post the above info and I will try to help you.

Hi Matt,

Thank you very much for the offer. I will definitely check out your book.

I have uploaded the excel file I was working on to dropbox:

https://www.dropbox.com/s/ulqepi127dhh1dc/ExampleBook.xlsx?dl=0

It is just 30 rows. ( I run a small business!)
It is a list of the products and their costs for the years 2015-2020. I have linked a calendar table with all the dates in the period.

As you will see from my attempt at the CostDifferencecomparedto2015 pivot table on the 2nd tab, I can't seem to get the measure to return the difference in cost for each year compared to 2015.
 
Upvote 0
If your data is only yearly (like in this example) then you probably don't need a calendar table. The reason your formula is not working is that you have referred to the wrong date column in your formula cost2015. If you are using a calendar table in your pivot table (like you have), then your formulas must use the calendar table. Or delete the calendar table and use the Year column from your data table and it will work.
 
Upvote 0
Hi guys,
I am new to power pivot (Less than a week). I am trying to calculate determine the cost difference for a given product each year compared to a give n reference year. My data is as below:


ProductYearCost
A201523
A201610
A20176
A20184
A20194
B201535
B201623
B201721
B201820
B201920

<colgroup><col span="3" width="64" style="width: 48pt;"></colgroup><tbody style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; margin: 0px; outline: 0px; padding: 0px;">
</tbody>
Ideally , I want to summarize the above into a table as below showing the difference in cost in each year per product compared to 2015. Below is an illustration.
Difference in Cost per year compared to 2015
Product20152016201720182019
A0-13-17-19-19
B0-12-14-15-15

<colgroup><col span="6" width="64" style="width: 48pt;"></colgroup><tbody style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; margin: 0px; outline: 0px; padding: 0px;">
</tbody>
I have tried several measures but they all seem to give wrong figures. I am out of ideas.
I am a total newbie and am supposing this could be very easy to most of you but I would appreciate help ideas on how to go about this.
Thanks.



Hello.. You can check in this video for your case
https://www.youtube.com/watch?v=kMMohkVk8Ds
Well this video is not mine actually, but you can learn from it.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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