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
DataUsurper
Helper II
Helper II

Create Measure to Avoid Circular Dependency

Hello All  o/

 

So, the backstory: We have determined approximately 40% of our orders have the pricing and totals zero'd out (whooooooole nother story), what we're wanting to do is create a calc to backfill those missing numbers with approximates values. I created a calc'd column to do so but am getting the circular dependency error. I created that column because I'm needing this applied to our line item detail records; or can this be made as a measure and still capture the right data/calcs?

 

My calc is a number of lookupvalue-logic-checks before calculating an average for our approximate price to backfill:

 

 

backfill = 
IF(

LOOKUPVALUE('tbl_Orders_Invd State'[IS_INVD],'tbl_Orders_Invd State'[s_OrderID_DAX],tbl_Orders_LineItemDetails[s_OrderID_DAX])="$0 Order" && 

LOOKUPVALUE('tbl_Orders_Invd State'[RENTAL_ITEMS],'tbl_Orders_Invd State'[s_OrderID_DAX],tbl_Orders_LineItemDetails[s_OrderID_DAX])>1 && 

LOOKUPVALUE('tbl_Orders_Invd State'[SHIPPED_ITEMS],'tbl_Orders_Invd State'[s_OrderID_DAX],tbl_Orders_LineItemDetails[s_OrderID_DAX])="Yes" &&

LOOKUPVALUE('tbl_Orders_Invd State'[RENTAL_ORDER],'tbl_Orders_Invd State'[s_OrderID_DAX],tbl_Orders_LineItemDetails[s_OrderID_DAX])="Yes" &&

tbl_Orders_LineItemDetails[SOURCE]="REV" && 

LOOKUPVALUE('key_ECODES.ECODE'[% Priced],'key_ECODES.ECODE'[ECODE.eCODE],tbl_Orders_LineItemDetails[ECODE.eCODE])>.5,

CALCULATE(AVERAGE(tbl_Orders_LineItemDetails[ACTUAL_PRICE]),tbl_Orders_LineItemDetails[ACTUAL_PRICE]>0,YEAR(tbl_Orders_LineItemDetails[SHIP_DATE])=YEAR(tbl_Orders_LineItemDetails[SHIP_DATE])),

tbl_Orders_LineItemDetails[ITEMTOTAL])

 

 Spacing added for legibility's sake.

 

Coulple screenies: (1) Measure w/ error & (2) example of line item records

Measure w/ errorMeasure w/ errorExample of line item detail dataExample of line item detail data

 

Thank you kindly for any assistance.

DU

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @DataUsurper ,

 

If the calculation of the result you want involves circular iteration, DAX cannot solve this kind of problem for the time being. It is recommended that you use Python or R to solve the problem.

Could you share the sample pbix through OneDrive for Business to see if we can avoid circular dependency.

 

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

DataUsurper
Helper II
Helper II

top of page bump

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