Opening Stock Value

MAKHDOOMLIAQAT

Board Regular
Joined
Jan 14, 2013
Messages
50
HI,

I am working on Cost of goods sold using Powerbi.



Above is my file which i uploaded on mediafire.

i am taking the average price by using average function year wise.
If you see in File.

GNameYearOpening StockInQtyOutQtyInItemValueAverage ValueClosing StockClosing Stock ValueOpening Stock ValueCost of Goods Sold
Bahria Town
2016​
4454​
3586​
126610299.8​
28426.20113​
868​
24673942.58​
0​
101936357.2​
Bahria Town
2017​
868​
6379​
6547​
166903971.5​
23030.76743​
700​
16121537.2​
0​
150782434.3​
Bahria Town
2018​
700​
9129​
8709​
271932546.3​
27666.3492​
1120​
30986311.11​
0​
240946235.2​
Bahria Town
2019​
1120​
9333​
9393​
313226466.8​
29965.22212​
1060​
31763135.45​
0​
281463331.4​
Bahria Town
2020​
1060​
10192​
10136​
362950101.2​
32256.49673​
1116​
35998250.35​
0​
326951850.8​
Bahria Town
2021​
987​
8882​
8468​
404199067.4​
40956.43605​
1530​
62663347.16​
0​
346819100.5​



In Above as you can see i just took the Average Value

Power Query:
Average Value = ([Opening Stock Value]+[initemvaluee])/([inqtyy]+[Opening Stock])


and closing stock value


Power Query:
Closing Stock Value = [Average Value] * [Closing Stock]


When i calculate the closing stock value of previous year its give me error.

Power Query:
circular dependency was detected: Measure: 'mak_stockInHandValue'[Average Value], Measure: 'mak_stockInHandValue'[Opening Stock Value], Measure: 'mak_stockInHandValue'[Average Value].

Any Suggestion to see the closing stock value in the field of opening stock value ?????

I am working on this from more than 2 weeks.

Please help me out

Thanks in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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