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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
YukiK
Impactful Individual
Impactful Individual

Normalizing one flat table into star schema - giving wrong numbers

I'm trying to create a star schema from one big flat table. I'm doing this with power query along with sql native queries (i don't have permissions to create views). I'm extracting multiple dim tables, but here is my process:

 

1. Extract dimension columns (i.g. area, region, sales office) and put them in a separate table
2. Remove duplicates based on columns that uniquely identify each row
3. Add an index column that uniquely identifies each row
4. Join this newly created dim table to the fact table on the columns that uniquely identify each row in the dim table
Remove these columns and keep the index column from dim table

 

Dim tables are connected on these index columns. But when I use a column from a dim table with a measure from a fact table, they give me wrong numbers. I've been trying to find the solution, but I have no idea at this point.

 

I appreciate any help!!!

1 ACCEPTED SOLUTION
YukiK
Impactful Individual
Impactful Individual

I ended up figuring out the issue on my own. And it was that I needed to sort tables before adding index(SK) columns and join dim tables to the fact table.

 

I didn't encounter this before, but this time, the data was huge and I suppose the distribution of SKs in fact table from dim tables got messed up. A lesson learned!

View solution in original post

3 REPLIES 3
YukiK
Impactful Individual
Impactful Individual

I ended up figuring out the issue on my own. And it was that I needed to sort tables before adding index(SK) columns and join dim tables to the fact table.

 

I didn't encounter this before, but this time, the data was huge and I suppose the distribution of SKs in fact table from dim tables got messed up. A lesson learned!

Greg_Deckler
Community Champion
Community Champion

@YukiK The logic seems sound. What kind of measures are you using and are your relationships in the right direction?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
YukiK
Impactful Individual
Impactful Individual

Not really using measure at this point. The relationships directions look correct and they base in SK columns I added. What's weird is that when I join, let's say, on category column (define each row uniqeuly) rather than SK columns, it works.

 

Somebody mentioned "auto-exist" migth be doing something...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.