Forum Discussion
Calculated table generates a circular dependency when joined
- 4 years ago
Update 2 - the fix was easy enough, even if figuring out the problem with circular dependency isn't always evident. By eliminating the blank row on the Customer table I was able to successfully build the realtionship in my data model. My new measure is:
# Buying PRONTO Customers = SUMX( ALLNOBLANKROW(Customer), SWITCH( TRUE(), Customer[# E1 Buying PRONTO Customers] > 0, 1, Customer[# CMA Buying PRONTO Customers] > 0, 1 ) )
Update -
Further troubleshooting has narrowed it down to a particular measure that is causing the problem. The column "BuyingPRONTOAccounts" on variable "tblData" is generated from a measure on the "Customer" table named "# Buying PRONTO Customers".
# Buying PRONTO Customers is calculated from two other measures, "# E1 Buying PRONTO Customers" and "# CMA Buying PRONTO Customers".
# Buying PRONTO Customers =
SUMX(
Customer,
SWITCH(
TRUE(),
Customer[# E1 Buying PRONTO Customers] > 0, 1,
Customer[# CMA Buying PRONTO Customers] > 0, 1
)
)
# E1 Buying PRONTO Customers =
CALCULATE(
Customer[# E1 Buying Customers],
'E1 Sales'[DocType] = "SH"
)
# CMA Buying PRONTO Customers =
CALCULATE(
Customer[# CMA Buying Customers],
Channel[Channel] = "Pronto"
)If I modify the BuyingPRONTOAccounts column in tblData to reflect either # E1 Buying PRONTO Customers or # CMA Buying PRONTO Customers, I don't get a circular dependency on the join between ISR and Customer.
How can I modify # Buying PRONTO Accounts to eliminate the circular dependency?
Thanks!
Update 2 - the fix was easy enough, even if figuring out the problem with circular dependency isn't always evident. By eliminating the blank row on the Customer table I was able to successfully build the realtionship in my data model. My new measure is:
# Buying PRONTO Customers =
SUMX(
ALLNOBLANKROW(Customer),
SWITCH(
TRUE(),
Customer[# E1 Buying PRONTO Customers] > 0, 1,
Customer[# CMA Buying PRONTO Customers] > 0, 1
)
)