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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
DebbieE
Community Champion
Community Champion

Star Schema Modelling issue when using Multiple datasets

Hi,

I think I have made a modelling mistake that on a single sta schema doesnt cause issues. Its because Im now pulling multiple data sets together and those data sets hold a star schema each. 

 

So I have the following:

 

StarSchema.png

they are at different levels of granularity and the ID is in the fact table so that the actual Work table can be aggregated on just WorkType so its a very small dim table

 

Using each seperately is fine but now I have hit this pulling in both data sets. I bring them together like this:

TwoStarSchemaBroughtTogether.png

And the report Is made up like this

 

TwoStarSchemaWrongReporting.png

So if you were to drag the ID Key froM fact table B into trips table you can see that its completely disconnected. So putting the ID into the fact table doesnt work when you bring together more than one fact table. I have a few options

1. Add ID into Work making that Dim table a lot bigger and it will be a 1 to 1 join onto the fact table

2. Create a seperate dim just for the ID (But it seems like an odd thing to da)

 

Is there another way of resolving this so i can leave the IDs in the Fact table. Whats the best practice I should be using here? Any help would be appreciated

1 ACCEPTED SOLUTION
DebbieE
Community Champion
Community Champion

No I cant share this pbix file.

 

And its all sorted. I created the dimension with the ID. removed the ID from the fact table. And I kept the higher dim with just the type in it for the star schemas at the higher level of granularity.

 

Took a while but it was worth it and everything is working well now

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Looks like this has been out here for a couple years but was wondering if the issue was actually one of not considering the purpose of the fact table. 

 

Why not simply have a FactCost fact table containing all "Costs" regardless of the cost type with columns WorkKey, CostKey, and Cost.  A dimension DimWork with columns WorkType, WorkKey, and ID.  A dimension DimCost with columns CostTypeKey, CostKey, and CostDescr. A dimension DimCostType with columns CostKeyType and CostTypeDescr.

 

This would allow for any new cost types to be added without the need for additional Fact tables.   Also allow simple aggregations to provide total costs, measures filtered by Cost Type for segmentation, and a much easier time doing calculations like cost or cost type as a percentage of total cost. 

DebbieE
Community Champion
Community Champion

Thats helped me figure out the plan. Create another dimension at the lowest level of granularity with the ID, And move the ID out of the fact table. Its a bit of work but it needs to be done.

 

 

bcdobbs
Community Champion
Community Champion

Hi Debbie are you able to share a pbix file and an idea of the desired output.

 

What you're describing is generally called a degenerate dimension by Kimball (https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimen...).

 

Normally you would leave it on the fact table but because you're looking to report at that level across two fact tables I think your best course of action it to pull it out as a dimension with just those id's in as you suggest. Anything else just leads to complex dax to pass the filters.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
DebbieE
Community Champion
Community Champion

No I cant share this pbix file.

 

And its all sorted. I created the dimension with the ID. removed the ID from the fact table. And I kept the higher dim with just the type in it for the star schemas at the higher level of granularity.

 

Took a while but it was worth it and everything is working well now

parry2k
Super User
Super User

@DebbieE Option 2, a dimension table for ID and all the common columns related to ID will go into this table and it will have relationship with both the fact tables.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.