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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
rcosarba
New Member

Merging Queries with same index numbers

Hey there,

 

Please bear with me, I am very new to Power Bi. I work in customer service survey data. I am creating a dashboard to visualize our survey data. I currently have 2 different data sources (survey results). These two surveys ask the same questions but one is personalized and one is a generic QR code-type survey. So they both have the same column names when exported.

 

I am trying to merge these queries, but because they are different surveys, they both have a starting index number of 1. I cannot make a relationship because they are not the same even though they have the same index number. Power Bi gives an error when trying to merge these queries. 

 

I *could delete the index numbers because their is another column with a unique identifier (response date/time). I am not using "index" in any of my calculated columns. 

 

What are best practices for this type of problem? 

 

Thank you!

1 ACCEPTED SOLUTION
nandic
Memorable Member
Memorable Member

@rcosarba as you mentioned that these two sources have same column names and questions, do you want to merge these tables or to make union?

Merge is used when you have same field in both sources and you want to keep source1 table, and just to add a few relevant columns from source2 table.
Example: table1 is customer table without phone number, table2 is customer details with phone number. You want to merge this two tables based on customer id (which matches in these two tables) and just to add field "phone number" from table1 to table2.

Union on the other hand is used when tables are the same, same structure, same columns.
And you just want to combine them, to put all into 1 table, instead of 2 tables.
Here is it is recommended approach to add new field in each table telling information about source (example: in source1 table you will add custom column with text "source1 table") so that you can use this information on the report.

Merge requires common field between tables based on which tables have relationship.
Union doesn't require common field, it requires same structure of tables.

Cheers,
Nemanja Andic

View solution in original post

1 REPLY 1
nandic
Memorable Member
Memorable Member

@rcosarba as you mentioned that these two sources have same column names and questions, do you want to merge these tables or to make union?

Merge is used when you have same field in both sources and you want to keep source1 table, and just to add a few relevant columns from source2 table.
Example: table1 is customer table without phone number, table2 is customer details with phone number. You want to merge this two tables based on customer id (which matches in these two tables) and just to add field "phone number" from table1 to table2.

Union on the other hand is used when tables are the same, same structure, same columns.
And you just want to combine them, to put all into 1 table, instead of 2 tables.
Here is it is recommended approach to add new field in each table telling information about source (example: in source1 table you will add custom column with text "source1 table") so that you can use this information on the report.

Merge requires common field between tables based on which tables have relationship.
Union doesn't require common field, it requires same structure of tables.

Cheers,
Nemanja Andic

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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