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

View all the Fabric Data Days sessions on demand. View schedule

Reply
stellion17
Regular Visitor

Avoiding Circular Dependency when Calculating Inventory Projection

Table.pngIMG2.pngIMG1.pngIMG3.pngI am soliciting forecast feedback from users for a product/location/futuredate combination and am trying to merge this feedback with an replenishment table to be able to show a monthly projected inventory balance in PowerBI. Example Formula (as would be calculated in Excel): Month 1 Figure = InitialInventory + SumInboundPOsMonth1 - ForecastMonth1. Month 2 = Month 1 Figure + SumInboundPOMonth2 - ForecastMonth2. Month 3 = Month 2 Figure + SumInboundPOMonth3 - ForecastMonth3, etc.

My issue in PowerBI is that I continue to run into circular dependency issues when referring to the forecast from the month prior in PowerBI. I've tried creating separate tables, calculated columns, measures, etc to no avail

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached files.

Hope these help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached files.

Hope these help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @stellion17 ,

DAX cannot reference the data in the previous row, i.e., DAX cannot implement iteration.

vjunyantmsft_0-1719974047068.png


But based on the information you provided, perhaps you can modify your formula to:
Month 1 Figure = InitialInventory + SumInboundPOsMonth1 - ForecastMonth1
Month 2 Figure = InitialInventor + ( SumInboundPOsMonth1 + SumInboundPOMonth2 ) - ( ForecastMonth1 + ForecastMonth2 )
Month 3 Figure = InitialInventor + ( SumInboundPOsMonth1 + SumInboundPOMonth2 + SumInboundPOMonth3 ) - ( ForecastMonth1 + ForecastMonth2 + ForecastMonth3 )
...............
As long as all the data in your SumInboundPOsMonth and ForecastMonth columns are present.

Or you can use List.Accumulate or List.Generate in Power Query, two M functions that enable iteration.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors