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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
EricPad
Regular Visitor

How to retreive constant value from related table

Hello - 

 

I have a PBI report I am working.  When I select a row from my table visual I want to retreive a quantity on hand from a related table. The table visual contains orders ordered by Item Code. I have an item table that has one row per item code. There is a total quantity on hand value that I want to retrieve from that table. 

When I attempt to select that value, it just returns the count and gives me the option to chose a different aggregate. I just want the single value for a given item code.

 

My report is displayed below as is my data model. 

EricPad_0-1724798464203.png

 

The table on the right (ItemOnOrderAndForecast) contains the orders and the tbl_CI_Items contains one row per ItemCode. 

Tbl_CI_Items has a one to many relationship with ItemsOnOrderAndForecast. 

EricPad_1-1724798741083.png

 

Do I need a measure to accomplish this? If so what should the measure look like?

 

Thank you in advance for your help!

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @EricPad

 

I've made a test for your reference:

1\I assume there are two tables

vbofengmsft_0-1724806487116.png

2\Create a measure for ItemOnOrderAndForecast

 
TestMeasure = LOOKUPVALUE(tbl_CI_ITEMS[TotalQuantityOnHand], tbl_CI_ITEMS[ItemCode], Max(ItemOnOrderAndForecast[ItemCode]))
 
Result

vbofengmsft_1-1724806525288.png

 

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

What you are doing is pulling a dimension attribute into the fact table.  That is often not required, but if you feel you need to do it anyway then you have to create a calculated column (not a measure) in your fact table  that says 

 

fact on hand = RELATED('tbl_CI_ITEMS'[TotalQuantityOnHand])

Anonymous
Not applicable

Hi @EricPad

 

I've made a test for your reference:

1\I assume there are two tables

vbofengmsft_0-1724806487116.png

2\Create a measure for ItemOnOrderAndForecast

 
TestMeasure = LOOKUPVALUE(tbl_CI_ITEMS[TotalQuantityOnHand], tbl_CI_ITEMS[ItemCode], Max(ItemOnOrderAndForecast[ItemCode]))
 
Result

vbofengmsft_1-1724806525288.png

 

Best Regards,

Bof

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors