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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HJK
Frequent Visitor

BOM Calculation (Circular reference error)

Hi

 

This is a circular referencing Excel example.
This is a sample of costing by rolling up the BOM.
The purchased sub-item E goes into D, and D and C go into B.
Finally, B goes into A.
At this time, the same column F is referenced, but a circular reference error occurs in POWER BI.

No error occurs in Excel.

(check the excel formula)
I want to implement this in Power BI.
How can I do it?

 

HJK_0-1670487905818.png

 

 

 

https://1drv.ms/x/s!AkdnitUw_Bk2gtZ-28gpeLo3q4LRoQ?e=Qg5TsM 

 
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @HJK 

 

You can try the following methods.
New table:

Table 2 = FILTER(SUMMARIZE('Table','Table'[Parent Item],'Table'[Type]),[Type]<>"Purchase")

vzhangti_0-1670569442250.png

Column:

Column = 
Var _N1=CALCULATE(SUM('Table'[Sub Amount]),FILTER('Table',[Parent Item]=EARLIER('Table'[Sub Item])))
Var _N2=CALCULATE(SUM('Table'[Sub Amount]),ALLEXCEPT('Table','Table'[Parent Item],'Table'[Sub Item]))
Return
IF([Type]="Purchase",_N2,IF([Sub Item] in VALUES('Table 2'[Parent Item]),_N1+_N2+_N1,_N1+_N2))

vzhangti_1-1670569479770.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

 

View solution in original post

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @HJK 

 

You can try the following methods.
New table:

Table 2 = FILTER(SUMMARIZE('Table','Table'[Parent Item],'Table'[Type]),[Type]<>"Purchase")

vzhangti_0-1670569442250.png

Column:

Column = 
Var _N1=CALCULATE(SUM('Table'[Sub Amount]),FILTER('Table',[Parent Item]=EARLIER('Table'[Sub Item])))
Var _N2=CALCULATE(SUM('Table'[Sub Amount]),ALLEXCEPT('Table','Table'[Parent Item],'Table'[Sub Item]))
Return
IF([Type]="Purchase",_N2,IF([Sub Item] in VALUES('Table 2'[Parent Item]),_N1+_N2+_N1,_N1+_N2))

vzhangti_1-1670569479770.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.