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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Data model to make a visual from two fact tables

Hello everyone,

 

I have 2 Fact tables that have the same composite primary keys (based on 5 columns) and are joined to the same dimensions. I have many measures created and I want to create a table visual in Power BI that fetches data from both facts. For example column 1 from the first fact and column 2 from the second fact.  But I noticed that some measures and other numeric fields return the same value, for example : 

col1  col 2

type1  500

type2 500

type3 500

Total 500

 

I know this is a modeling problem, should I merge both facts into one fact table since they have the same PKs ? which join method should I use inner, full outer ... ?

 

Thank you in advance ! 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

You have choices. If the data in the 2 fact tables is like data, then appending is a good option. Eg, sales by day and budget by day. If the data is not like data, then 2 fact tables is a better option, eg sales by day and budget by month. If you keep 2 fact tables, you need a common dimension table and maybe bridge tables to join them. Do not join them directly. If there is a common key in both tables, create a new dim table containing all possible values of the key without duplication. Join both facts to the dim. Hide the key column in the fact tables and only ever use the key column from the dim table in your visuals



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi  @Anonymous ,

 

The output value of your measurement is the same, which may be related to the measure value. If you can, you can share your measure value

 

You can also take a look at the link for the relationship between tables:

https://docs.microsoft.com/zh-cn/power-bi/transform-model/desktop-relationships-understand

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MattAllington
Community Champion
Community Champion

You have choices. If the data in the 2 fact tables is like data, then appending is a good option. Eg, sales by day and budget by day. If the data is not like data, then 2 fact tables is a better option, eg sales by day and budget by month. If you keep 2 fact tables, you need a common dimension table and maybe bridge tables to join them. Do not join them directly. If there is a common key in both tables, create a new dim table containing all possible values of the key without duplication. Join both facts to the dim. Hide the key column in the fact tables and only ever use the key column from the dim table in your visuals



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

They both analyse somewhat similar data on a monthly & yearly basis. So which join option would you recommend ? I don't wanna lose data so I'm thinking about a full outer,, what do you think ?

 

For the bridge table I altready tried it out : I extracted the PK columns from both tables made a union and deleted all duplicates, I then created a unique ID which is basically a concatenated value from all 5 columns then linked both facts to that bridge, it didn't work 😞 I'm new to all this data thing so maybe there's something wrong in my process. Also creating a bridge table with millions of rows has made my Azure Analysis Services a bit slow in deployment.

It's had to say without seeing the details. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.