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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
odzelashvili1
Helper I
Helper I

Star schema or SQL script

Hello everybody ^^

 

I have one simple question, which is better a star schema, or one table which is made by SQL script?

 

In my database I have fact table, and some dimension tables, for power BI I'm importing data by SQL Script, so I have only one table and only needed columns, is this correct? or it is better to import fact table and also dimension tables and than make relationships in my model?

 

Thanks a lot 🙂

1 ACCEPTED SOLUTION

Hi 

 

@amitchandak is absolutely right, it is best to use the Dimension tables and Fact tables then relate them in PowerBi instead of 1 Flat table. You will run into issues later with your data model if it's just one table.

 

example of star schema:case.png

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@odzelashvili1 , Star Schema is always better. If you have say 5 tables, bring them into one is not a good idea.

 

Having 3 or 5 in a star schema is better.

 

Also refer

https://www.sqlbi.com/articles/the-importance-of-star-schemas-in-power-bi/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank u for your reply 🙂

 

So, to be more clear:

 

I have 1 fact table, with 20 column, where is only IDs and I need only 10 columns for my report. Also in my DB there is 19 dimension tables.

 

I have two ways: 1) Write SQL Script, where I get 10 column with values, not IDs and import 1 table in my data model, or 2) Import 10 tables, 1 Fact table (only needed columns), and 9 (also only needed columns) dimension tables and make relationships between them.

 

As u told, its better to use second way, am i right?

 

thanks again 🙂

Hi 

 

@amitchandak is absolutely right, it is best to use the Dimension tables and Fact tables then relate them in PowerBi instead of 1 Flat table. You will run into issues later with your data model if it's just one table.

 

example of star schema:case.png

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.