Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
avanderhoorn
Regular Visitor

Avoiding circular dependency when adding new columns that have dependencies

Currently i have a query that returns a bunch of log messages that I'm interested. For some of these messages, they have unique identifiers which means that when looking at the data in a matrix, each item takes up a separate row. To get around this, I have another query which has a mapping of strings with masks to the friendly message i want shown:

 

Pattern > NewMessage

"Time of day is: *" > "Time of day is: [TIME]"

"Product * was deleted" > "Time xxx was deleted"

...

 

To make this work, I have the property `Message` on the `ClientMessages` query that has the original content and a calculated property that has controls how the pattern is applied and returns the `NewMessage` based on the `Pattern` from the `_MessageOverride_` query. That query looks like the below:

 

 

MessageOverride = 
VAR Matches = 
    CALCULATETABLE(
        GENERATE(
            ClientMessages,
            FILTER(
                _MessageOverride_,
                SEARCH(
                    [Pattern],
                    [Message],
                    1,
                    0
                   )
                   >0)
             )
          )
VAR matchMessage = CONCATENATEX(
        Matches,
        [NewMessage],",")
RETURN IF(ISBLANK(matchMessage), [Message], matchMessage)

 

 

All the above works great, not a problem. The problems start when I try and do more "operations" based on this new `MessageOverride` column. 

 

For instance, I have another table, which allows me to override the `Type` a given message has. This table looks like the below:

 

Message > NewType

"Time of day is: [TIME]" > Other

"Time xxx was deleted" > Crud 

...

 

I went to setup a relationship between the `Message` column in this `_MessageTypeOverride_` query, to the new `MessageOverride` column from the above DAX query (so that I could have a new column based off it), but I end up getting the below circular dependency error. You will note that I want to be able to base the relationship off the result (i.e. "Time of day is: [TIME]") rather than the source (which has unique data in it). 

 

> A circular dependency was detected: ClientMessages[MessageOverride], ClientMessages[TypeOverride], {GUID}, ClientMessages[MessageOverride]

 

 

TypeOverridden = 
VAR FaultTypeRelated = RELATED(_MessageTypeOverride_[NewType])

RETURN IF(ISBLANK(FaultTypeRelated), ClientMessages[FaultType], FaultTypeRelated)

 

I tried setting up the same DAX query I have for the old messages to new messages to try and get around the problem, but I ended up getting the same issue.

 

I know from reading hear - https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/ - why I am getting the circular reference, but I don't know how to do what I need to do differently to avoid the issue.

 

Thoughts?

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @avanderhoorn

According to your reference link, how about using ALLNOBLANKROW in a FILTER function when  using CALCULATE or CALCULATETABLE?

Also, we need consider the relationship among tables used in these formula.

Could you share me some dataset or pbix including all columns and tables used in the formula above?

 

Best Regards

Maggie

 

Hi @avanderhoorn

After testing with your pbix, I find it doesn’t cause a circular dependency issue until editing the relationship between table “_FaultMessageTypeOverride_” and “ClientFaultEvents”.

As far as I know, the original relationship based on “ErrorMessage” column in both tables can work well, so maybe you don’t need to change this relationship.

 

Best Regards

Maggie

I agree that things currently "work" and that they break when I change the relationship between table “_FaultMessageTypeOverride_” and “ClientFaultEvents”, but thats the point.

 

The current relationship isn't correct. I need the relationship to change to be between _FaultMessageTypeOverride_[ErrorMessage] and ClientFaultEvents[ErrorMessage] to be between _FaultMessageTypeOverride_[ErrorMessage] and ClientFaultEvents[ErrorMessageOverride].

 

I understand that I might not be able to do what I want to do just via a simple relationship, but I need some way of being able to determine the "FaultType" off the "Overriden" error message.

Hi @avanderhoorn

I recommend you to open a ticket here to solve your problem.

 

19.png

 

Best Regards

Maggie

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.