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
Anonymous
Not applicable

Avoid Circular Dependency in Power BI for Calculated Column

I have two tables "Report Images" and "Cost". Both does not have any relationships. Both tables are in below structure.

 

ReportImages 

Image URL          Indicator

 

Cost Table

Indicator             Other Cost Details

 

I tried to create a calculated column in Cost table taking the column "ImageURL" from "Report Images" table matching the Indicators column in both tables. It is giving me circular dependency error.

 

Please help. I need to create only calculated column and not a measure.

 

Below is the query I have used.

 

Calculated Column = CALCULATE(VALUES(ReportImages[ImageURL]),FILTER(ReportImages,ReportImages[Indicator] = Cost[Indicator])
1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

You can try the following steps.

 

1 Make some changes to the Calculated column ‘COSTIndicatorColor’

COSTIndicatorColor =

var res1=CALCULATE(SUM(Invoices[TOTAL_AMOUNT]),FILTER(Invoices,Invoices[ProjectUID]=PlannedPayment[ProjectUID]),DISTINCT(Invoices[ProjectUID]))

var res2=CALCULATE(SUM(PlannedPayment[PlannedPayment]),ALLEXCEPT(PlannedPayment,PlannedPayment[ProjectUID]))

var res=res1-res2

return IF(res < -15,"#FF0000",IF(res >= -15 && res < -5, "#D3D3D3","#33AF81"))

 

2 Create a Calculated column

Calculated Column = CALCULATE(VALUES(ReportImages[ImageURL]),FILTER(ReportImages,ReportImages[Indicator]=PlannedPayment[COSTIndicatorColor]))

 

Here is the pbix.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? 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

6 REPLIES 6
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

You can try the following steps.

 

1 Make some changes to the Calculated column ‘COSTIndicatorColor’

COSTIndicatorColor =

var res1=CALCULATE(SUM(Invoices[TOTAL_AMOUNT]),FILTER(Invoices,Invoices[ProjectUID]=PlannedPayment[ProjectUID]),DISTINCT(Invoices[ProjectUID]))

var res2=CALCULATE(SUM(PlannedPayment[PlannedPayment]),ALLEXCEPT(PlannedPayment,PlannedPayment[ProjectUID]))

var res=res1-res2

return IF(res < -15,"#FF0000",IF(res >= -15 && res < -5, "#D3D3D3","#33AF81"))

 

2 Create a Calculated column

Calculated Column = CALCULATE(VALUES(ReportImages[ImageURL]),FILTER(ReportImages,ReportImages[Indicator]=PlannedPayment[COSTIndicatorColor]))

 

Here is the pbix.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , a new column in cost table

 

maxx(FILTER(ReportImages,ReportImages[Indicator] = Cost[Indicator]),ReportImages[ImageURL])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  No still it show the same.

 

Ramees_123_0-1615824447227.png

 

Anonymous
Not applicable

@amitchandak Cost[Indicator] is also another calculated field which I created in the report.

 

Indicator = IF([COSTMeasure] < -15,"#FF0000",IF([COSTMeasure] >= -15 && [COSTMeasure] < -5, "#D3D3D3","#33AF81"))

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Please find the below link to download the pbix file. Check for the table planned payment and inside that I have tried to created a calculated column which gives circular dependency error.

 

https://1drv.ms/u/s!Ah-kO6CqeTNOgh0FAF1T4GD22ocK?e=E0g2Ph

 

Please help.

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