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
Alberto95
Frequent Visitor

circular dependency

hi, i've a problem with circular dependency. 

i need 2 different calculated colums. 

the first one it's a calculated colum with some if conditions (i did it without problems)

the second one is a column which contain the first calculated column in the formula. that's give me a circular error. 

 

IMPORTO_NETTO = if(VENDITE_ICG[COD_CLIENTE] = "266463IN"  && VENDITE_ICG[COD_PORTO] = "M" && VENDITE_ICG[COD_CANTIERE] = "372632" && VENDITE_ICG[VAL_TRASP]03, calculate(SUM(VENDITE_ICG[VAL_TRASP])/SUM(VENDITE_ICG[QTA])))))))
 
VAL_TRASP_1 = CALCULATE(SUM(VENDITE_ICG[QTA])*SUM(VENDITE_ICG[IMPORTO_NETTO]),(ALLEXCEPT(VENDITE_ICG,VENDITE_ICG[IMPORTO_NETTO])))
 
the structure is easy, 2 tables: data table and vendite_icg (1-n relationship)
 
 
could someone help me? 
thanks
 
 
2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Alberto95 

 

After testing, the computed column detects circular dependencies. But measure doesn't.

vzhangti_0-1672194258006.png

 

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.

amitchandak
Super User
Super User

@Alberto95 , can you share excat error

 

Try like

 

VAL_TRASP_1 = CALCULATE(SUM(VENDITE_ICG[QTA])*SUM(VENDITE_ICG[IMPORTO_NETTO]),filter(VENDITE_ICG,VENDITE_ICG[IMPORTO_NETTO] = earlier(VENDITE_ICG[IMPORTO_NETTO]) ))

 

refer: https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/

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.

Top Solution Authors