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
GVTioluxe
Helper I
Helper I

Looking up field values with inactive relationships between tables

Hi

 

I have a few tables in my model and one of them is the Shipment Plan Table which has field of Origin Port Code and Destination Port Code of the Order. I have a Port Master from which I would like to get the Port Name.

 

The Port Table has active relationship with the Sales Order Table which also have Origin and destination Ports. 

Since the Shipment Plan is connected with Sales Order, trying to make active connection with Port Table is causing error of ambiguity due to which it doesnt allow.

 

hence i have left the the relationships as inactive between Shipment Plan and Port and would like to use the userelationship dax to create 2 measures one for Origin Port Name and another for destination Port Name.

 

I tried following 2 options - 

Option1 -

Origin Port Name = Lookupvalue(Port[PorName], Port[Portcode],shipmentplan[portcode])

here the last field of port code in shipment plan doesnt come up to complete the dax.

 

Option 2 -

Origin Port Name = Calculate(Max(Port[portname]),Userelationship(shipmentplan[portcode],port[portcode])

 

this is returning the last value of port names alphabetically.

 

can someone guide me on thr right way to solve this problem?

 

regards

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@GVTioluxe , are you trying to create a new column, In that case, it will only return one value, if there is more than one value then min and max need to be used.

 

Refer : https://www.youtube.com/watch?v=czNHt7UXIe8

Hi

 

No. I am trying to create a measure to return the Port name, which i will use in the Table/ Matrix Visual

 

regards

Hi @GVTioluxe,

Can you please share some dummy data with the original data structure to help us clarify your data structure and test coding formula?

How to Get Your Question Answered Quickly 
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
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.