Powerpivot to calculate value filtered based on its own table

budiyantointernet

New Member
Joined
Jun 27, 2013
Messages
1
Hi Everyone,
i'm new in powerpivot and still exploring on how to use DAX. I have a problem that currently i cant found how to do it in DAX.
Basically i have a table similar like this


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Datekey
[/TD]
[TD]Product Code
[/TD]
[TD]Store
[/TD]
[TD]This Week Inventory
[/TD]
[TD]This Week Sales
[/TD]
[TD]Inventory Week Supply
[/TD]
[/TR]
[TR]
[TD]20130601
[/TD]
[TD]Product A
[/TD]
[TD]X
[/TD]
[TD]10
[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20130601
[/TD]
[TD]Product A
[/TD]
[TD]Y
[/TD]
[TD]20
[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20130608
[/TD]
[TD]Product A
[/TD]
[TD]X
[/TD]
[TD]6
[/TD]
[TD]4
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20130608
[/TD]
[TD]Product A
[/TD]
[TD]Y
[/TD]
[TD]15
[/TD]
[TD]5
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20130615
[/TD]
[TD]Product A
[/TD]
[TD]X
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Inventory Weeksupply = this_week_inventory / average this_week_sales for next 3 weeks

i need to calculate the inventory weeksupply, meaning for example for datekey 20130601 for Product A in Store X the formula should be 10 / Average(4,3) = 10/3.5 = 2.85

What is the best approach to do this calculation ?

Thanks in Advance for sharing.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Why are you working out the weeks supply for 1st june using the weeks in the future as seems an impossible task i.e. you don't know the future? i could understand if you were working out how many weeks supply you have on june 16th based on the 3 previous weeks. is that what you meant?

My solution would be to use RANKX to rank the "this week sales" by store by product. This would give you a calculation for the most recent week, but do you need to know the number for the previous weeks as well? I'm guessing you are looking for a snap shot so you can see if all your stores have 3 weeks of stock across products? If you want a full historical table i'd have to give it more thought. let me know if the date order is as i think and if a snapshot is what you are after and I'll think u a formula.

Mike
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,595
Members
452,657
Latest member
giadungthienduyen

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