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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DanielPasalic
Helper II
Helper II

Lookup Table 2 and Table 3 and fill the missing values in columnes of Table 1

Hi all

Hopefully, someone can help me to solve the problem as I tried so many times but did not succeed. 
Basically, what I want is to fill the missing values in the following columns of

Table 1:

art.nr
art.id
art.name

 

by looking up the values from Table 2 and three. 

Table 1 and Table 2 have the same values in each raw:

segment id
market coverage % need
market coverage % total

Table 1 and Table 3 have the same values in each raw:

country
region
sub-region

Table 2 and Table 3 have the same values in each raw:

art.nr
art.id

 

art.nr and art.id are unique for each raw
segment id, country, region, sub-region, market coverage % need and market coverage % total are not unique for each raw 
but in combination (all together) should give a unique value 

 

Is there a way I can do some kind of lookup and fill the missing values in Table 1 from table 2 and Table 3 based on the data with same values from columns in combination,  so I have the complete data?

 

Help would be greatly appreciated.

 

Table 1Table 1

 

Table 2Table 2

 

Table 3Table 3

 

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @DanielPasalic 

 

[market coverage % need] and [market coverage % total] is typically not columns one would use for joining. 

 

Looking at your data it seems like there is no unique combination of [market coverage % need], [market coverage % total], [segment id], [country], [region] and [sub region]. But not quite sure, hard to read from from your screen shots(usually easier for anyone to help you if you share a sample report or sample datasett instead of screen shots).

 

Anyway, if the combinations of the mentioned columns are unique, you can do the following:

1. create new columns in table 3:

Segment ID =
LOOKUPVALUE (
    'Table 2'[segment ID],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)
Segment ID =
LOOKUPVALUE (
    'Table 2'[market coverage % need],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)
Segment ID =
LOOKUPVALUE (
    'Table 2'[market coverage % total],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)

 

2. In table 1 create the column [art.nr] like this

art.id =
LOOKUPVALUE (
    'Table 3'[art.id],
    'Table 3'[segment id], 'Table 1'[segment id],
    'Table 3'[country], 'Table 1'[country],
    'Table 3'[region], 'Table 1'[region],
    'Table 3'[sub-region], 'Table 1'[sub-region],
    'Table 3'[market coverage % total], 'Table 1'[market coverage % total],
    'Table 3'[market coverage % need], 'Table 1'[market coverage % need],

)

 

If the combinations of the columns are not unique, you will get an error message

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

 

View solution in original post

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi @DanielPasalic 

 

[market coverage % need] and [market coverage % total] is typically not columns one would use for joining. 

 

Looking at your data it seems like there is no unique combination of [market coverage % need], [market coverage % total], [segment id], [country], [region] and [sub region]. But not quite sure, hard to read from from your screen shots(usually easier for anyone to help you if you share a sample report or sample datasett instead of screen shots).

 

Anyway, if the combinations of the mentioned columns are unique, you can do the following:

1. create new columns in table 3:

Segment ID =
LOOKUPVALUE (
    'Table 2'[segment ID],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)
Segment ID =
LOOKUPVALUE (
    'Table 2'[market coverage % need],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)
Segment ID =
LOOKUPVALUE (
    'Table 2'[market coverage % total],
    'Table 2'[art.nr], 'Table 3'[art.nr],
    'Table 2'[art.id], 'Table 3'[art.id]
)

 

2. In table 1 create the column [art.nr] like this

art.id =
LOOKUPVALUE (
    'Table 3'[art.id],
    'Table 3'[segment id], 'Table 1'[segment id],
    'Table 3'[country], 'Table 1'[country],
    'Table 3'[region], 'Table 1'[region],
    'Table 3'[sub-region], 'Table 1'[sub-region],
    'Table 3'[market coverage % total], 'Table 1'[market coverage % total],
    'Table 3'[market coverage % need], 'Table 1'[market coverage % need],

)

 

If the combinations of the columns are not unique, you will get an error message

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

 

Greg_Deckler
Community Champion
Community Champion

@DanielPasalic - Difficult to follow. Can you post sample source data as text and the results of that sample data that you expect?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.