Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
William_Moreno
Helper II
Helper II

Create opening and closing stock in the data columns (trouble with circular dependecy)

Hi guys, again I need help!

 

My problem today is about circular dependecy.
I tried to build a data table for opening e closing stock, but I've had faced problems to finish it.

I need to do it with columns data, at this point I didn't want to use measures. Is it possible?

 

Table

 

LocalCodeUMDataOpeningStockSalesOrderNecessityClosingStockGoal
ItalyPACKGINGUN01/03/2021230.200791.907504.000891.601833.895833.895
ItalyPACKGINGUN01/04/2021833.895860.442756.000104.442833.895833.895
ItalyPACKGINGUN01/05/2021833.895926.2481.008.0000915.646833.895
ItalyPACKGINGUN01/06/2021915.646988.9200907.168833.895833.895

 

The column Necessity has this formula: 
IF(Goal - (OpenningStock + Order - Sales)<0;0;Goal - (OpenningStock + Order - Sales))

The column ClosingStock has this formula: 

OpeningStock + Order + Necessity - Sales

 

Someone could help me?

Thanks a lot.

William M.

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @William_Moreno 

 

Download sample PBIX fle

 

I'm not getting a circular dependency error with those column calculations.  You are?  If so please show screenshots and more details.

Here are my columns

Necessity = IF([Goal] - ([OpeningStock] + [Order] - [Sales])<0, 0 , [Goal] - ([OpeningStock] + [Order] - [Sales]))
ClosingStock = [OpeningStock] + [Order] + [Necessity] - [Sales]

circ.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @William_Moreno 

 

Download sample PBIX fle

 

I'm not getting a circular dependency error with those column calculations.  You are?  If so please show screenshots and more details.

Here are my columns

Necessity = IF([Goal] - ([OpeningStock] + [Order] - [Sales])<0, 0 , [Goal] - ([OpeningStock] + [Order] - [Sales]))
ClosingStock = [OpeningStock] + [Order] + [Necessity] - [Sales]

circ.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi Phillip, thanks for answer me. I've forgot to say that the column OpeningStock has to be calculated by this logical formula is the CloseStock of the last month. Thanks again.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors