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
Varshi288
Resolver I
Resolver I

Circular Dependency error

Hi,

 

Hi as I saw lot of post on circular dependency error but I am not able to figure out where circular dependency occurring from . I am attaching the calculated measures used.

selling price = MP(SP) and Transfer price = MP(TP).

 

MP (SP) = divide((Data_OMS[SP]),sum([BU list price]))

MP (TP) = divide((Data_OMS[TP]),sum([BU list price]))

 

TP = IF(HASONEVALUE('Report Currency'[Code]),SUMX(Data_OMS,'Data_OMS'[TP $]*[FX report]),SUMX(Data_OMS,Data_OMS[TP $]))

SP = IF(HASONEVALUE('Report Currency'[Code]),SUMX(Data_OMS,'Data_OMS'[SP $]*[FX report]),SUMX(Data_OMS,Data_OMS[SP $]))

 

I am creating two calculated column as MP (SP) range & MP (TP) range. How ever the formula is correct for MP(TP) range whereas for MP (SP) range im getting circular dependency error. If I create the same formula as a measure this looks fine and not showing any error.but I require this as column.

Can someone explain why is this happening pls and how to resolve.

 

 

Calculated Cloumn

 

MP (TP) range = SWITCH(

TRUE(),

[MP (TP)]>1,"1.00=>",

[MP (TP)]<=1.00 && [MP (TP)]>0.95,"0.95 - 1.00",

[MP (TP)]<=0.95 && [MP (TP)]>0.90,"0.90 - 0.95",

[MP (TP)]<=0.90 && [MP (TP)]>0.85,"0.85 - 0.90",

[MP (TP)]<=0.85 && [MP (TP)]>0.80,"0.80 - 0.85",

[MP (TP)]<=0.80 && [MP (TP)]>0.75,"0.75 - 0.80",

[MP (TP)]<=0.75 && [MP (TP)]>0.70,"0.70 - 0.75",

[MP (TP)]<=0.70 && [MP (TP)]>0.65,"0.65 - 0.70",

[MP (TP)]<=0.65 && [MP (TP)]>0.60,"0.60 - 0.65",

[MP (TP)]<=0.60 && [MP (TP)]>0.55,"0.55 - 0.60",

[MP (TP)]<=0.55 && [MP (TP)]>0.50,"0.50 - 0.55",

[MP (TP)]<=0.50 && [MP (TP)]>0.45,"0.45 - 0.50",

[MP (TP)]<=0.45 && [MP (TP)]>0.40,"0.40 - 0.45",

[MP (TP)]<=0.40 && [MP (TP)]>0.35,"0.35 - 0.40",

[MP (TP)]<=0.35 && [MP (TP)]>0.30,"0.30 - 0.35",

[MP (TP)]<=0.30 && [MP (TP)]>0.25,"0.25 - 0.30",

[MP (TP)]<=0.25 && [MP (TP)]>0.20,"0.20 - 0.25",

[MP (TP)]<=0.20 && [MP (TP)]>0.15,"0.15 - 0.20",

[MP (TP)]<=0.15 && [MP (TP)]>0.10,"0.10 - 0.15",

[MP (TP)]<=0.10 ,"< 0.10",

"NOT DEFINED")

 

 

 

Calculated Column.

MP (SP) range = SWITCH(

TRUE(),

[MP (SP)]>1,"1.00=>",

[MP (SP)]<=1.00 && [MP (SP)]>0.95,"0.95 - 1.00",

[MP (SP)]<=0.95 && [MP (SP)]>0.90,"0.90 - 0.95",

[MP (SP)]<=0.90 && [MP (SP)]>0.85,"0.85 - 0.90",

[MP (SP)]<=0.85 && [MP (SP)]>0.80,"0.80 - 0.85",

[MP (SP)]<=0.80 && [MP (SP)]>0.75,"0.75 - 0.80",

[MP (SP)]<=0.75 && [MP (SP)]>0.70,"0.70 - 0.75",

[MP (SP)]<=0.70 && [MP (SP)]>0.65,"0.65 - 0.70",

[MP (SP)]<=0.65 && [MP (SP)]>0.60,"0.60 - 0.65",

[MP (SP)]<=0.60 && [MP (SP)]>0.55,"0.55 - 0.60",

[MP (SP)]<=0.55 && [MP (SP)]>0.50,"0.50 - 0.55",

[MP (SP)]<=0.45 && [MP (SP)]>0.40,"0.40 - 0.45",

[MP (SP)]<=0.40 && [MP (SP)]>0.35,"0.35 - 0.40",

[MP (SP)]<=0.35 && [MP (SP)]>0.30,"0.30 - 0.35",

[MP (SP)]<=0.30 && [MP (SP)]>0.25,"0.25 - 0.30",

[MP (SP)]<=0.25 && [MP (SP)]>0.20,"0.20 - 0.25",

[MP (SP)]<=0.20 && [MP (SP)]>0.15,"0.15 - 0.20",

[MP (SP)]<=0.15 && [MP (SP)]>0.10,"0.10 - 0.15",

[MP (SP)]<=0.10 ,"< 0.10",

"NOT DEFINED")

 

Error message

A circular dependency was detected: Data_OMS[MP (SP) range], Data_OMS[MP (TP) range], Data_OMS[MP (SP) range].

 

 

1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @Varshi288 

The below article from @AlbertoFerrari , will explain your problems with circular dependencies.

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

 

Regards,
Mariusz

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

 

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.