THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Alberto Ferrari

Circular Dependencies in DAX

What is a circular dependency? If A depends on B and B depends on A, then you have a circular dependency. As programmers, we know that they should be avoided to obtain a working system. All this looks fine but, when authoring a simple DAX formula containing CALCULATE, SSDT (formerly known as BIDS, sometimes called Visual Studio… I love Microsoft attitude to find new names) warned me about circular dependency errors and, believe me, there seemed to be no loops inside my formulas.

After some fight with the tool, it turned out that anytime you use CALCULATE in a formula for a calculated column you are in danger for a circular dependency and, to solve the issue, the easiest way is to add a key column to a table. Understanding why the problem exists is not trivial and it requires you to read the article I have published on the SQLBI website here: http://www.sqlbi.com/articles/understanding-circular-dependencies/.

Clearly the scenario is the same for PowerPivot 2012 and for Tabular in SSAS 2012.

Happy reading! And, as always, comments are very welcome.

BTW: Happy new year to everybody! In case you forgot it, THIS is the year of SQL2012. Sorriso

Published Tuesday, January 03, 2012 10:29 AM by AlbertoFerrari

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(required) 
Submit

About AlbertoFerrari

Alberto Ferrari is a Business Intelligence consultant. He his interests lie in two main areas: BI development lifecycle methodologies and performance tuning of ETL and SQL code. His main activities are with SSIS and SSAS for the banking, manufacturing and statistical sectors. He is also a speaker in international conferences like European PASS Conference and PASS Summit.
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement