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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Lutinho
Frequent Visitor

Creating classification column by matching multiple columns from other table

Dear Power BI community,

 

I am trying to classify rows in my dummy data based on 4 columns; country, area, subarea and name. 

 

I am trying to create a logic somehow like this:

- If in a row in the dummy data, the 4 columns match the same combination as in of the 4 columns in the lookup table --> take the classification from the lookup table.

- If the column values don't match, insert missing.

 

The lookup table can be interpreted like this:

- The 2nd row will result in all rows having country code 035, regardless of the other column values (since they are empty), will get the classification 'Pie'.

- 21st row will will result in all rows having country code 005 AND name AKKE will also get the classification 'Pie'.

 

Explanation lookup table.png

 

I have no idea how to get this done in Power BI. Does anyone have a solution? Thanks in advance. The attached dummy data contains many rows, I hope that is not a problem.

 

Dummy data that needs to be classified:

https://drive.google.com/file/d/1qyysu-f5HktutCR372Nx8jS0EbnGNkSv/view

Classification/lookup table:

https://drive.google.com/file/d/1Mpb8-XnQY2kP8NkUhqs9pixV39Ee8tV7/view

 

Thanks in advance, again 🙂

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Lutinho ,

 

According to your requirements, the logic needs 16 IF formulas at least. Considering the amount of data and the complexity of your logic, this may lead to very low performance.

So I don't recommend that you use Power BI to complete it.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Lutinho ,

 

According to your requirements, the logic needs 16 IF formulas at least. Considering the amount of data and the complexity of your logic, this may lead to very low performance.

So I don't recommend that you use Power BI to complete it.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thanks for your reply. Was hoping there was some strong Power BI function to take care of this. Unfortunately, there isn't. Have a great day!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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