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
nigel_s
Frequent Visitor

Link reference table twice without duplicating data.

Given the following tables

 

Trip

ID

FromLocationID

ToLocationID

 

Location

ID

Name

City

 

I want to be able to use the location name for both the From and To in Trip but you can't create two active relationships. I can use Lookup, but if I wanted to reference City and Name, that becomes a pain, I really want to reference the entire table. I can add the Location table twice and link From and To separately but I think this duplicates the data in the Location table. 

Is there a way to include a reference table twice but make the second a virtual copy of the first?

 

What's the best way to do this? In my actual model Location is used multiple times with several fact tables, with multiple location fields.

 

Thanks in advance for your help.

1 REPLY 1
DataInsights
Super User
Super User

@nigel_s,

 

You can create an inactive relationship and use the DAX function USERELATIONSHIP to activate the inactive relationship. In this example, the active relationship would be between Location[ID] and Trip[FromLocationID]. The inactive relationship would be between Location[ID] and Trip[ToLocationID]. Example measure:

 

Count Trip ID - To Location =
CALCULATE (
    COUNT ( Trip[ID] ),
    USERELATIONSHIP ( Location[ID], Trip[ToLocationID] )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.