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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Starstorm
Frequent Visitor

Need Help With Dataset With A Mapping Table To Create New Columns

Hi,

 

Basically, I am trying to map the "Mapping Table" to my "Primary Data".

 

Here are the dummy data to illustrate the logic intended. As you can see, the columns highlighted in grey are the variables for Primary Data, which are also found in Mapping Table as the conditions.

 

How it should work? All 3 variables from primary data must tally with mapping table in order to output the respective country and model. For instance, for the first row of the data 11111, Seagate and Hard drive - it will give me US and A respectively [as illustrated in End Result].

 

So here are my queries:

  1. Of course, the easiest way I could think of is just to CONCATENATE these 3 variables into a single string - all mapping table strings are unique, and then create a relationship with Primary Data. However, is there a more 'proper' way of doing it in Power BI instead of doing CONCATENATE?
  2. For my mapping table, you will realize for Account Number 99999 - it does not have the Brand and Product. This is intentional because I want to also create a rule whereby so long the account number is 99999, it will become NK and Q regardless of the Brand and Product. However, my method of [1] will not work for [2] because 99999 because my mapping table will not be able to find the common string at primary data table. Is there a way to resolve this having both [1] and [2]?

 

This is just a dummy data; in actuality, I have over 60+ different brands, and 60+ different products - so it is not possible for me to create multiple rows.

Primary Data.pngMapping Table.png

End Result.png

 

Please let me know if you need more information to assist my case here.

 

Thank you, and appreciate your support and guidance.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

I think you can create a column in both tables like

Mapping Column = IF ( 'Table'[Account number] = "99999", 'Table'[Account number],
COMBINEVALUES( "|", 'Table'[Account number], 'Table'[Brand], 'Table'[Product])
) 

where 'Table' would be the table you are creating the column in. You should then be able to create a one-to-many relationship from your mapping table to your primary data

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

I think you can create a column in both tables like

Mapping Column = IF ( 'Table'[Account number] = "99999", 'Table'[Account number],
COMBINEVALUES( "|", 'Table'[Account number], 'Table'[Brand], 'Table'[Product])
) 

where 'Table' would be the table you are creating the column in. You should then be able to create a one-to-many relationship from your mapping table to your primary data

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.