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

  • Announcing template apps one-click update May 11, 2021
    Announcing new capability that makes it easy for template app users to update their apps in one simple step!
  • Announcing the new sharing experience May 6, 2021
    We’re excited to announce a new sharing experience that allows sharing reports via links. Previously in the old experience, we supported sharing reports by granting direct access. For the new experience, reports can be shared via links in addition to direct access sharing.
  • Announcing support for backup and restore of Power BI datasets May 6, 2021
    e are excited to announce the public preview of Backup and Restore for datasets in Power BI Premium and Premium per User (PPU). You can now use SQL Server Management Studio (SSMS), Analysis Services cmdlets for PowerShell, and other tools to perform backup and restore operations in Power BI via XMLA endpoints in much the […]