cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors