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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
carrienorris
New Member

Inconsistent Data When Using Relationship on Index column between a Merged Table and a Source Table

For my data model, I added two tables, Order_Transaction and Product_DetailLastLevel which are MS SQL Queries. The data is imported into Power BI.


On Order_Transaction, I added an index column starting at 1.

carrienorris_0-1684934964300.png

 

I then used the Merge feature to merge the Order_Transaction table with the Product_DetailLastLevel table on the SKU column. I expanded all the merged columns. Works great.

carrienorris_1-1684935359025.png

The new merged table breaks the data out into the product components (for instance on product bundles, now instead of 1 line for the purchase of a bundle, might have 3 lines for that one purchase, one for each component of the bundle.)

 

After applying changes, in the relationships, I created a relationship between Order_Transaction and Merge1 on the Index column.

carrienorris_2-1684935680240.png

Now in a table visual, I add some columns from both these tables and there's some serious weirdness happening. From both tables I added Index and Order ID.

 

carrienorris_0-1684937525222.png

As shown above, none of the order id's seem to match their index. When I go back to the query and filter for a specific index in both the Order_Transaction table and the Merge1 table to check the data, the data matches between the two tables, it just doesn't show the right data on the table visual.

 

Does anyone know what's happening? Did I miss a step somewhere? Can I not rely on a relationship on Index columns?

 

Any help is appreciated.

Carrie

1 REPLY 1
some_bih
Super User
Super User

Hi @carrienorris my best practice when I merge columns in PQ: write number of rows before any "transformation" per table / columns. During merging if you notice PQ inform you how many rows are mathed from one table to another one. If counting rows before and after merging do not fit / make sense then depending on your need change type of join (left to rights etc) and for sure check are there in columns some blank rows or similar. 

Sometimes, it is expected to have "lower" number of matched rows between tables as it is possible that like some products are never /not sold but this product is in catalogue. I hope this help





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.