cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sjpaq
Regular Visitor

Calculated column using inactive relationship

I have 2 calculated columns in a table that use an inactive relationship to a date dimension table. The first column works fine and the second column gives a circular reference error.

First Column

Breach Rpt Date = CALCULATE(
    Min('cda datedim'[Date]),USERELATIONSHIP('cda breach'[Breach Reporting Date],'cda datedim'[DateId]
    ))
This returns the correct value, a date 
Second Column
Breach Rpt Fiscal Year = CALCULATE(
    Min('cda datedim'[FiscalYear]),USERELATIONSHIP('cda breach'[Breach Reporting Date],'cda datedim'[DateId]
    )) 
The 2 expressions are identical except that the column selected (highlighted in red) in each is different. Why does the second give a circular reference error as in:
sjpaq_0-1675093169221.png

 Thanks in advance

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @sjpaq,

Perhaps you can try to directly extract the current table value as conditional to filter and get the correspond table records to stored into the variable.

Then you can and manually use this in the formulas without USERELATIONSHIP function. (I think the issue should related to USERELATIONSHIP function and it may generate the temp relationship mappings for the calculations)

Understanding circular dependencies in DAX - SQLBI
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.