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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
yanzhao_LBS
Helper II
Helper II

Cirlular denpendency to calculate the opening and ending inventory

hello i want to create the opening and ending inventory like this 

yanzhao_LBS_0-1698026125933.png

but the system error :Cirlular denpendency was detected . I know there is a Cirlular denpendency,but is there any possible to  achieve my request?

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1698041751260.png

 


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

View solution in original post

3 REPLIES 3
yanzhao_LBS
Helper II
Helper II

@Ritaf1983 Thanks for your reply. I am trying to attach the file but found only Wetransfer is available for me but it seems need the receiver's email address to make the share file. if you can give me a email i can send the pbix file to you .

 

i am trying to make the data here

 

table1 inventory

nameOpening inventoryDate
A1002023-1-1
A02023-2-1
A02023-3-1
A02023-4-1
A02023-5-1
A02023-6-1
A02023-7-1
A02023-8-1
A02023-9-1
A02023-10-1
A02023-11-1
A02023-12-1

table 2 sales

nameSalesDate
A102023-1-1
A202023-2-1
A32023-3-1
A52023-4-1
A102023-5-1
A72023-6-1
A82023-7-1
A92023-8-1
A12023-9-1
A22023-10-1
A32023-11-1
A32023-12-1

Table 3-date

dateYearmonth
2023-1-1202301
2023-2-1202302
2023-3-1202303
2023-4-1202304
2023-5-1202305
2023-6-1202306
2023-7-1202307
2023-8-1202308
2023-9-1202309
2023-10-1202310
2023-11-1202311
2023-12-1202312

and 

 

create Measure 

End Inventory =[Open Inventory]-SUM(sales[Sales])
Open Inventory = CALCULATE([End Inventory],DATEADD('date'[date],-1,MONTH))+SUM(Inventory[Opening inventory])
 
I know that End Inventory & Open Inventory are in the endless loop, but want i want is 
Open Inventory(current month)=End Inventory(last month)
End Inventory(current month)=Open Inventory(current month)-sales(current month)
 
just like this.
yanzhao_LBS_0-1698039367881.png

Thanks.

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1698041751260.png

 


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

Hi @yanzhao_LBS 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.