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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
dax_user
New Member

Merged Values Change Before and After Query

Hi all,

 

This article describes almost identically what is happening in my dataset: Solved: Values in table change when expanding table column - Microsoft Fabric Community

 

It seems to happen somewhat randomly; however, my index values (surrogate keys as see in screenshots) will change after expansion. How do I fix the order of my fact table and my dimension table so that it does not re-evaluate and shift the values from my merge? I've read that Sorting or Table.Buffer helps but there's no context as to when this is supposed to happen. Does it have to occur after or before every merge? Right when I load the data in from the warehouse? At the end of the dimension table creation? I'd appreciate any context as to why this happens & what I could do to prevent this in future scenarious as well.  Thanks to the community in advance for all of the help.

Below are samples of the query of both one of my dimension tables and fact tables.

pq_2.pngpq_1.png

 

3 ACCEPTED SOLUTIONS
Akash_Varuna
Resident Rockstar
Resident Rockstar

Hi could you try first sorting those fact and dim tables based on the key columns before trying to merge those tables

Then use Table.Buffer to freeze the data afterb sorting

Then merge them

If there are transformations to the data try doing those before the merge happens

 

View solution in original post

BA_Pete
Super User
Super User

Hi @dax_user ,

 

The real question is: Why is it important that your rows stay in the same order? The Vertipaq engine will only muddle them up again as soon as you apply the query to the model.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

PwerQueryKees
Super User
Super User

And sort order is not define in PowerQuery, except after a sort. As was stated by Imke in the solution of the post you referred to in your post.

View solution in original post

8 REPLIES 8
v-menakakota
Community Support
Community Support

Hi @dax_user ,

Thank you for reaching out to us on the Microsoft Fabric Community Forum.

As @Akash_Varuna mentioned,try sorting those Fact and Dim tables before trying to merge those tables

Regards,
Menaka

Hi @dax_user ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Hi @dax_user ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Regards,
Menaka.

Hi @dax_user ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

PwerQueryKees
Super User
Super User

And sort order is not define in PowerQuery, except after a sort. As was stated by Imke in the solution of the post you referred to in your post.

BA_Pete
Super User
Super User

Hi @dax_user ,

 

The real question is: Why is it important that your rows stay in the same order? The Vertipaq engine will only muddle them up again as soon as you apply the query to the model.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




PwerQueryKees
Super User
Super User

Sorry, I don't get it. What is you problem? The Merge of the employees show the correct keys as far as Ican tell. What were you expecting?

Does it have to do with the sort order? I would do this last (or not at all and leave it to PBI or Excel.

Akash_Varuna
Resident Rockstar
Resident Rockstar

Hi could you try first sorting those fact and dim tables based on the key columns before trying to merge those tables

Then use Table.Buffer to freeze the data afterb sorting

Then merge them

If there are transformations to the data try doing those before the merge happens

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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