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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AlexaderMilland
Helper III
Helper III

Circular dependency between two calculated columns that uses "UseRelationship".

So in my model i have my order tabel,

where i have an EmployeeID in colunms like 

PickedBy

ShippedBy

ControlledBy etc.

 

I then have an employee table with information like the ID, name etc. that i have related on the employeeid to each and every column where it could be relevant throuh inactive relationships. 

AlexaderMilland_0-1670338924714.png

 

 

When i try to create a column on the orders tabel that includes the name from the related table I can only get it to work on 1 column, the rest i get 

AlexaderMilland_1-1670338975325.png

 

Essentially i created the "ShipmentBy" measure first and that one totally works. When i try to make new calculated columns I get this circular dependency error.

 

Here is the shipment by column that works.

 

ShipmentBy =
CONVERT(Orders[ShipmentStartBy],STRING)&" ("&
            CALCULATE (
                SELECTEDVALUE ( 'MappingEmployeeID'[Name] ),
                CALCULATETABLE (
                    'Orders',
                    USERELATIONSHIP ( MappingEmployeeID[userid], 'Orders'[ShipmentStartBy] ),
                    REMOVEFILTERS ( 'MappingEmployeeID' )
                )
            )
            &") / "&
CONVERT(Orders[ShipmentCompletedBy],STRING)&" ("&
            CALCULATE (
                SELECTEDVALUE ( 'MappingEmployeeID'[Name] ),
                CALCULATETABLE (
                    'Orders',
                    USERELATIONSHIP ( MappingEmployeeID[userid], 'Orders'[ShipmentCompletedBy] ),
                    REMOVEFILTERS ( 'MappingEmployeeID' )
                )
            )&")"
 
 
Here is the picked column that does not work.
 
PickedBy =
CONVERT(Orders[OrderPickedStartBy],STRING)&" ("&
            CALCULATE (
                SELECTEDVALUE ( 'MappingEmployeeID'[Name] ),
                CALCULATETABLE (
                    'Orders',
                    USERELATIONSHIP ( MappingEmployeeID[userid], 'Orders'[OrderPickedStartBy] ),
                    REMOVEFILTERS ( 'MappingEmployeeID' )
                )
            )
            &") / "&
CONVERT(Orders[OrderPickedCompletedBy],STRING)&" ("&
            CALCULATE (
                SELECTEDVALUE ( 'MappingEmployeeID'[Name] ),
                CALCULATETABLE (
                    'Orders',
                    USERELATIONSHIP ( MappingEmployeeID[userid], 'Orders'[OrderPickedCompletedBy] ),
                    REMOVEFILTERS ( 'MappingEmployeeID' )
                )
            )&")"
 
 
Is it only possible to have 1 calculatetable and userelationship?
2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @AlexaderMilland ,

 This error by creating calculated colum?,Why not try with measure? 

 

If you do have the error with creating a calculated colum, you could have a reference of this similar thread which has been solved.

 

If you still need help, please share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to public link. Do mask sensitive data before uploading.)

 

 

 

Best Regards

Lucien

Couldn't see a solution in the posted example. I've attached a link to a google drive containing a sample data.
Basically on the order table i want the Partner Name columns on each version. I can only get 1 of the 3 calculated columns to work (the first one)

.https://drive.google.com/file/d/1DA0AVhokYtpDas-UJrZUQGC9baySSa4B/view?usp=sharing 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.