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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
GVTionale
Helper II
Helper II

measure to get field value from lookup table using inactive relationship with Fact Table

Hi

 

I have in my Customer Order Fact Table, 2 fields Origin Port ID and Destination Port ID. I have the Port lookup Table which has the Port ID, Port Name, Country etc. I have created Active relationship with the Origin Port ID and an inactive relationship with the Destination Port ID.

 

Can someone help me to get the correct Dax measure to get the Port Name for destination port ?

 

regards

3 REPLIES 3
Anonymous
Not applicable

Hi @GVTionale ,

 

Check the measures and relationship as below and see if the result is what you want.

Measure = CALCULATE(MAX('Port lookup Table'[Port Name]),USERELATIONSHIP('Port lookup Table'[Port ID],'Table'[Origin Port ID]))

Measure 2 = CALCULATE(MAX('Port lookup Table'[Port Name]),USERELATIONSHIP('Port lookup Table'[Port ID],'Table'[Destination Port ID]))

1.PNG

2.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AllisonKennedy
Super User
Super User

@GVTionale  You could use: 

 

COLUMN Destination Port = LOOKUPVALUE(PortTable[Port Name], PortTable[Port ID], FactTable[Destination Port ID])

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi Alison,

 

The destination port has inactive relationship with port lookup table for which i saw the solution posted in following link to use calculate dax with userelationship. 

 

https://carldesouza.com/power-bi-dax-userelationship-multiple-dates/

 

My query is whatdax to use in the calculate DAX to lookup the portname if i apply the DAX shown in the post

 

Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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