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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aJ2
Helper I
Helper I

Circular Dependency when not using calculated function

Hi everyone.

 

Initially after encountering this error, I figured out that using calculated was the main source of this problem, I took another route and then used 'IF' to get the values. 

But when I am using the two calculated columns to create another column, I encountered this error.

Following are the calculated columns:-

 

1. revenue gross = IF(order_items[is_item_gross], [revenue all], 0) // calculated column

2.  revenue net = IF(order_items[is_item_net], order_items[revenue gross], 0) // calculated column

3. rev progress = IF(order_items[is_item_in_progress], order_items[revenue net],0) // calculated column 

4. rev inprogress shipped = [% shipped2] * order_items[revenue in progress] //calculated column

5.  orders sold = IF(order_items[is_item_sold],order_items[order gross],0) // calculated column

6. order gross = IF(AND(order_items[orders all], order_items[is_item_gross]),1,0) // calculated column

7. 

% shipped2 =
var progress_order = CALCULATE([orders sold], order_items[is_item_in_progress], order_items[delivery_status]="Shipped", order_items[status]="Shipped")/*IF(AND(VALUES(order_items[is_item_in_progress]), AND(VALUES(order_items[is_item_gross]), VALUES(order_items[delivery_status])="Shipped")), [orders gross],0)*/
var in_progress_order = CALCULATE([orders sold], order_items[is_item_in_progress])/*IF(VALUES(order_items[is_item_in_progress]), [orders gross],0)*/

return (DIVIDE(progress_order,in_progress_order))// measure

 

8. rev progress not shipped = VALUE(order_items[rev progress]) - VALUE(order_items[rev inprogress shipped])// calculated column and error "A circular dependency was detected: order_items[rev inprogress shipped], order_items[rev progress not shipped], order_items[rev inprogress shipped]" // calculated column

 

 

Kindly guide.

 

Regards

aJ2

1 ACCEPTED SOLUTION

@v-chuncz-msft,

 

Thanks for the reference.

I altered my approach. To calculate the column 'rev progress not shipped', I created local variables in the calculated column and then used the local variables in the calculation. 

 

rev progress not shipped = 
var progress_order = IF(AND(order_items[is_item_in_progress], sales_order_items[status]="Shipped"), sales_order_items[orders sold],0)
var in_progress_order = IF(order_items[is_item_in_progress], order_items[orders sold],0)
var shipped = DIVIDE(progress_order,in_progress_order)
var inprog_shipped = shipped * order_items[rev progress]
 
return (order_items[rev progress] - inprog_shipped)

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@aJ2,

 

You may take a look at the following articles.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft,

 

Thanks for the reference.

I altered my approach. To calculate the column 'rev progress not shipped', I created local variables in the calculated column and then used the local variables in the calculation. 

 

rev progress not shipped = 
var progress_order = IF(AND(order_items[is_item_in_progress], sales_order_items[status]="Shipped"), sales_order_items[orders sold],0)
var in_progress_order = IF(order_items[is_item_in_progress], order_items[orders sold],0)
var shipped = DIVIDE(progress_order,in_progress_order)
var inprog_shipped = shipped * order_items[rev progress]
 
return (order_items[rev progress] - inprog_shipped)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.