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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
badger123
Resolver I
Resolver I

Multiple fact tables to resolve many to many relationships

Hey,

 

I want to store data on customers and some calculated, categoric behavioural labels, e.g. X and Y customers are millenials and male. I have too many labels to have columns in a customer table (about 100 labels). 

 

Therefore there's a many to many relationship between labels and customers. Customers can have many labels and labels can be assigned to many customers.

 

There is a similar story with holidays and holiday labels. Customers are then linked to what holidays they go on.

 

Is the below with multiple linking tables efficient in PowerBI or would it be more efficient to have a central (but very long) fact table that links all the keys? Or is this approach completely wrong. 

 

 

 

data_erd.jpg

 

Any help massively appreciated!

(Example is a dummy example so apologies if there are flaws)

 

 

 

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi  @badger123 

I would suggest you use star schema in power bi.

For more details, please refer to these:

https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

https://radacad.com/power-bi-basics-of-modeling-star-schema-and-how-to-build-it

 

Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Having a bit of trouble visualizing the data, can you post example data (not all 100 columns!!)

 



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...

Hi @Greg_Deckler, Sorry I can't, it's sensitive data. Does the diagram not give you enough to understand? Let me know if you have specific questions. Thank you!!

 

Not looking for the data, just some representation of the data. For example, you talk about customers and lables, well is that (see below). But, no a picture of your data model is not enough to describe what "all the keys" means. The only information that can be provided with just a picture of a data model is that you generall want to use a star schema.

 

Customer Label Value
Customer 1 Label 1 blue
Customer 1 Label 2 green
Customer 1 Label 3 plate
Customer 2 Label 1 red
Customer 2 Label 2 blue
Customer 2 Label 3 cup

or

Customer Label 1 Label 2 Label 3
Customer 1 blue green plate
Customer 2 red blue cup

 



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...

Hello @Greg_Deckler 


Thanks for offering your help with this. I am struggling to come up with a simple and efficient solution after a few attempts, so I thought it would be helpful to take a step back and show you what I'm tyring to do.

I've included a sample of what data I have below. Here are a few examples of what I questions I would like to answer with this data:
What is the the total value of a category across countries or for a country for a given date or time period?
What is the the total value of an item across countries or for a country for a given date or time period?
What is the total valoue of negative sentiment vs positive sentiment for an item for a given date or time period?
What is the total value of positive sentiment across all fruits for a given date or time period?

 

CategoryItemStringSentimentCountryDateValue
FruitOrangeI like oranges and applespositiveUKJan-2010
FruitAppleI like oranges and applespositiveUKJan-2010
FruitOrangeI like oranges and applespositiveUSJan-2030
FruitAppleI like oranges and applespositiveUSJan-2030
FruitOrangeI like oranges and applespositiveUKFeb-2060
FruitAppleI like oranges and applespositiveUKFeb-2060
FruitOrangeI like oranges and applespositiveUSFeb-2040
FruitAppleI like oranges and applespositiveUSFeb-2040
FruitOrangeI like oranges and applespositiveUKMar-20100
FruitAppleI like oranges and applespositiveUKMar-20100
FruitOrangeI like oranges and applespositiveUSMar-20120
FruitAppleI like oranges and applespositiveUSMar-20120
FruitOrangeI don't like orangesnegativeUKJan-2030
FruitOrangeI don't like orangesnegativeUKFeb-2020
FruitOrangeI don't like orangesnegativeUKMar-2050
VegetableCarrotCarrots are nicepositiveUKJan-20200
VegetableCarrotCarrots are nicepositiveUKFeb-20300
VegetableCarrotCarrots are nicepositiveUKMar-20400
VegetableLeekI don't enjoy leeksnegativeUSJan-205
VegetableLeekI don't enjoy leeksnegativeUSFeb-2020
VegetableLeekI don't enjoy leeksnegativeUSMar-2015


Trying to figure out the best way to split this into separate tables. I'm finding it challenging because value is based on each string at a country level for each date. The same string might exist in more than one country. A string can be mapped to multiple items and an item can have multiple strings. So how can I best build the model so that it recognises that Orange is the same item across countries but it has different strings (and hence values) for each country.


Any ideas would be much appreciated!

Hi,

Could you kinldy show the exact results you are expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.