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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
v-jayw-msft
Community Support
Community Support

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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