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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
lg1551
Resolver II
Resolver II

LOOKUPVALUE From One Table to Another Based on Calculated Columns?

Table 1 has a 'Generate Series' calculated column which provides a list of values.

Table 2 has a 'Category Column' and the calculated column for the 'Category Score'.

 

I am trying to lookup the 'Category Column' value from Table 2 so that it appears next to the Value in Table 1 that matches the 'Category Score' from Table 2. When I do a LOOKUPVALUE it returns blank. What's the workaround?

 

Table 1 I want this result in Table 1. Table 2 
      
Value Category CategoryCategory Score
1   A2
2 A B5
3 E C8
4   D10
5 B E3
6     
7     
8 C   
9     
10 D   
1 ACCEPTED SOLUTION

I figured it out. It was the decimal from Category Score that was the culprit. I wrapped that calculated column in a "FIXED" function and it works fine now. Thank you for troubleshooting with me!

View solution in original post

9 REPLIES 9
sevenhills
Super User
Super User

Add this measure in Table 1

Value - Category = 
CALCULATE(MAX('Table2'[Category]), 'Table2'[Category Score] = SELECTEDVALUE(Table1[Value]))

 

For the table visual, you need to enable this setting

sevenhills_1-1691685662696.png

 

Output:

sevenhills_0-1691685638960.png

 

If you have the relationship like this, you can try ... 

sevenhills_2-1691686197282.png

 

Measure:

Value - Category 2 = LOOKUPVALUE(Table2[Category], Table2[Category Score], SELECTEDVALUE(Table1[Value]))

It works the same way!

Yes, I have the relationship between the two tables. I've tried RELATED, LOOKUPVALUE, and the first approach you posted. None of the approaches gives an error, they all three just return blank. The Category value doesn't come over. Both the "VALUE" column and the "Category Score" columns are formatted as whole number. I don't understand what the issue is.

Still returning blank for me.

 

This isn't a table visualization. This is literally 2 tables in the model.

Table 1 is a calculated table with the "Value" column generated using "Generate Series"

 

Table 2 is a table with the Category dimension and a calculated column for Category Score.

Tried this and it worked!

Table3 = GENERATESERIES(1, 10, 1)

 

Measure

Value - Category 3 = LOOKUPVALUE(Table2[Category], Table2[Category Score], SELECTEDVALUE(Table3[Value]))

 

Relationships

sevenhills_0-1691686609627.png

 

sevenhills_1-1691686625726.png

 

 

it worked when I tried

I figured it out. It was the decimal from Category Score that was the culprit. I wrapped that calculated column in a "FIXED" function and it works fine now. Thank you for troubleshooting with me!

If any of my solution helped, marked my reply also as "Accept as Solution"

Again, just returning blanks. 

 

The Category Score is a calculated column, which returns a decimal value, so I have to format it to whole number. I'm wondering if it's trying to use the decimal value in the background, which is why it is returning blanks?

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.