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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alexlibby
Frequent Visitor

Merge Queries or Use Relationships

Good afternoon,

I have a question about when to use Relationships vs Merge Queries in Power Query. I have two large files. There are about 23,333 rows and tons of columns in each. One file is Historic and the other is current and they each have a unique identifier (constituent ID). I've read that you should condense your data as much as possible, so I thought I would use relationships to report the two related queries. But, just watched a video saying merge queries are the way to go. Does anyone have any guidance for me?

2 ACCEPTED SOLUTIONS
Migasuke
Super User
Super User

Hi,

unfortunatelly there is not a one single solution . Main goal for merging the tables is to keep you model simple and easier to understand.
Imagine you have 30 tables in your model and you create relationship for all of those - it will become very messy. It is better to do maybe some merging and instead of having 30- you might lower it for 15(depends on data) and suddenly is much easier to understand what is going there.

If you know your model will be easy to understand even without some Power Query transformation, you can just keep the relationships with Dimensions and Fact tables - but in most cases you will combine both approaches.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

Fowmy
Super User
Super User

As per your explanation, I would suggest you try to minimize the number of columns in both the tables considering the reporting requirements. It is always better to keep your fact table "Thin and Long", if required you may UnPivot the columns. In this way, the relationship will be effective. Merging the table increases the columns which may hinder the performance and size.

Modeling Tips: https://powerbi.microsoft.com/en-us/blog/best-practice-rules-to-improve-your-models-performance/

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

As per your explanation, I would suggest you try to minimize the number of columns in both the tables considering the reporting requirements. It is always better to keep your fact table "Thin and Long", if required you may UnPivot the columns. In this way, the relationship will be effective. Merging the table increases the columns which may hinder the performance and size.

Modeling Tips: https://powerbi.microsoft.com/en-us/blog/best-practice-rules-to-improve-your-models-performance/

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Migasuke
Super User
Super User

Hi,

unfortunatelly there is not a one single solution . Main goal for merging the tables is to keep you model simple and easier to understand.
Imagine you have 30 tables in your model and you create relationship for all of those - it will become very messy. It is better to do maybe some merging and instead of having 30- you might lower it for 15(depends on data) and suddenly is much easier to understand what is going there.

If you know your model will be easy to understand even without some Power Query transformation, you can just keep the relationships with Dimensions and Fact tables - but in most cases you will combine both approaches.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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