DAX modelling circular reference error

I’ve been working on a new power BI model this week, with the intent of showing historical attributes of work done over time.   So I end up with table OrdersPFMHistory which contains a key that indicates a state at a point in time.  The Orders table, has that same key.  The intent is to use RELATED() to identify if the historical key exists.

relationship issue

However, every time I create that relationship, it would seem to work until I switch to the graph view.  This is the error I would then receive.

Circular loop

Error Message:

The model contains an unexpected cycle among associations with to-one cardinality.

Stack Trace:

Invocation Stack Trace:

Activity Id
10496d75-f154-45a6-8d96-1db6c138b385

Time
Mon Nov 23 2015 12:02:56 GMT-0700 (Mountain Standard Time)

Version
2.28.4190.122 (Stabilization)

After much noodling around, I discovered that it was not complaining about a circular reference, but rather about the way that relationship could be filtered.  It turns out that powerBI assumes that you’ll want to filter from both sides of the relationship (this seems to be the default).  Setting the cross filter direction to “Single” alleviates this issue.  Technically, it seems that this should have worked as “both”, and that this is just a bug.

cross filter

I’m posting about this, as the solution is not overly obvious.  Someone else is likely to run into this issue.

 

Tags :
Far better an approximate answer to the right question, which is often vague, than the exact answer to the wrong question, which can always be made precise. -John Tukey
The plural of anecdote is not data. - John Myles White

Recent Posts

RSS PowerBI blog