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
akhaliq7
Continued Contributor
Continued Contributor

Data Modelling: using the column from you fact table or bringing in a dim table just for that field

I have a scenario where I have a field in my fact table so I have a sales fact table and I have in the sales table a field called product category and product sub category the table has 20,000 rows. in my DB I have two tables called product category and product sub category. These two tables has 100,000 and 200,000 rows respectively. Should I remove the two fields from my fact table and bring in the two dim tables intead or shall I stick with those fields in the fact table? 

 

p.s. I have a all the necessary id's to connect the tables. product_id to connect to the product table product sub category id and then the category id.

1 ACCEPTED SOLUTION
ITManuel
Responsive Resident
Responsive Resident

Hi @akhaliq7 ,

 

I'm wondering why your dimensions (product category & product sub category) have 100.000/200.000 rows. Normally there should be one unique row for each category /subcategory in these tables. Are there that many categories / subcategories?

 

In any case I would follow the reccomended method of creating a star schema by creating a relationship with the sales table using product category id  and product sub category id. In that case you can remove the product category and product sub category columns in the sales tables in power query, eventually already in the data source.

 

Br

View solution in original post

2 REPLIES 2
ITManuel
Responsive Resident
Responsive Resident

Hi @akhaliq7 ,

 

I'm wondering why your dimensions (product category & product sub category) have 100.000/200.000 rows. Normally there should be one unique row for each category /subcategory in these tables. Are there that many categories / subcategories?

 

In any case I would follow the reccomended method of creating a star schema by creating a relationship with the sales table using product category id  and product sub category id. In that case you can remove the product category and product sub category columns in the sales tables in power query, eventually already in the data source.

 

Br

akhaliq7
Continued Contributor
Continued Contributor

The names of the tables I just made up I don't like to give away any details about the db I work but yes my fact table has 20,000 rows and my dim tables some times has 100,000/200,000 rows it may be because its a customers table and it keeps historic data.

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.