How to Calculate Sum and Average in Power Pivot Data Model

happy1001

New Member
Joined
Jan 17, 2016
Messages
14
Hello

I have got stock market data in a Table, which I want to import inside Power Pivot Data Model and then create some new columns.

I have prepared a very small sample excel file. The real data is quite large in size. And I have also prepared a very SIMPLE Example for learning the method of how we can calculate CHANGE and PERCENTAGE CHANGE COLUMNS inside PP Data Model.

Once these 2 new columns are calculaed, then I also want to calculate these 4 new columns as well, if that is not very hard to do -

Past 2 Day Sum of ClosePrice
Past 3 Day Sum of ClosePrice
Past 2 Day Average of ClosePrice
Past 3 Day Average of ClosePrice

I have attached the excel file that has got -
Source Data Table
Expected Data Table
and the data has been imported into the Data Model.

I do not have any experience in dealing with Data Models yet. Please suggest how we can get the desired output inside Data Model. I am not completely sure, if such calculations can be done inside Data Model or not, but I think it should be possible, either directly or by using some complex DAX Codes etc.

I am using the following software versions -
Microsoft SQL Server Management Studio version- 12.0.2000.8,
Microsoft Office Professional Plus 2016 x64
and Windows 7 x64

Thanks a lot for any help.

Regards
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Source_Data.png







Expected_Result.png
 
Upvote 0
I do not know why but I am facing a lot of difficulty in adding attachments and snaps ! The attachment button is not working properly. That's why I have to add the files in multiple posts. Still not being able to attach the excel sheet for this thread.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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