cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akhaliq7
Helper V
Helper V

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
Helper V
Helper V

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
Helper V
Helper V

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

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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors