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
katina
Helper I
Helper I

How to map data to categories and sub categories (appr. 500 unique rows)

Hi

 

I attach here an example of my current task; I must map one list of items to categories and their subcategories. 

My challenge right now is that what would be the most efficient way to implement this mapping? Data comes from the data platform and the categories are sent me in an Excel sheet. 

 

I created an illustration to explain this in a more conrete way; yellow "side" shows the data structure. Combination of the three separate fields defines the category and subcategory (blue "side")

 

katina_0-1741847408861.png

 

 

Is the bridge table the most clever way to solve this? If I create if clauses in Power Query - I think my report will collapse in a seconds and the data consists of about 500 unique rows that must be mapped to categories and subcategories. I have 4-5 main categories and 3 - 12 subcategories for each main category.

 

Thank you - every idea is welcome 🙂!

-katina

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@katina , Yes bridge table would be good for this '

 

Create a Bridge Table: This table will map the combination of fields from your data to the corresponding categories and subcategories. The bridge table should have columns for each of the fields that define the category and subcategory, as well as columns for the main category and subcategory.

 

Load your main data table.
Load the bridge table.'

In the Power BI model view, create relationships between your main data table and the bridge table based on the fields that define the category and subcategory.

Use the fields from the bridge table to categorize your data in reports. This way, you avoid complex if clauses and ensure your report remains performant.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
katina
Helper I
Helper I

Thank you for your comments!

 

Could I somehow benefit from the data platform where I get the main data? I mean do you find any solution to at least partially maintain the mapping table? 

I try to summarize the data sources here:

- Main data; it updates hourly and comes from the data platform

- Categories and subcategories comes from an external supplier in Excel file

 

Now I export the main data to excel and create manually the mapping table. Is there any way to avoid manual steps?

rajendraongole1
Super User
Super User

Hi @katina  - A bridge table (mapping table) is indeed the best approach for handling this type of categorization efficiently in Power BI. you can convert the Excel category mapping (right-side of your image) into a structured mapping table.
This table should have three key fields from your data (Product Category, Product Subcategory, Department) and the corresponding Main Category and Subcategory.Import both your main dataset and this mapping table into Power BI.

Connect the main dataset to the mapping table using three fields:
Product Category
Product Subcategory
Department
This ensures that each row in the main dataset gets automatically assigned the correct Main Category and Subcategory from the mapping table. Hope these details helps .

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you! The bridge table is a quite new thing to me - I understand the idea. How do I create the relationship; 3 separate relations from the main table to the mapping table? 

bhanu_gautam
Super User
Super User

@katina , Yes bridge table would be good for this '

 

Create a Bridge Table: This table will map the combination of fields from your data to the corresponding categories and subcategories. The bridge table should have columns for each of the fields that define the category and subcategory, as well as columns for the main category and subcategory.

 

Load your main data table.
Load the bridge table.'

In the Power BI model view, create relationships between your main data table and the bridge table based on the fields that define the category and subcategory.

Use the fields from the bridge table to categorize your data in reports. This way, you avoid complex if clauses and ensure your report remains performant.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.