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

  • On-premises data gateway October 2021 update is now available October 20, 2021
    On-premises data gateway (standard and personal mode) release for October 2021
  • Power BI Desktop Installer Changes & WebView2 October 13, 2021
    As mentioned in the June and July feature summaries, we are switching a vital component of Power BI from CefSharp to WebView2. We’re making this switch to better optimize our development and release process (which means we’ll be able to spend more time developing new features!). It also means that you’ll automatically get the latest […]
  • Power BI October 2021 Feature Summary October 12, 2021
    Welcome to the October 2021 update. Leaves fall, Power BI calls; and we are excited to release additional functionality and performance improvements for DirectQuery, optimization for the SWITCH function,  and new Bitwise DAX functions.