Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

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.

 

  • 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

     

  • Hi Anonymous ,

     

    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

  • 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.

8 Replies

  • 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

     

  • 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.

  • Hi Anonymous ,

     

    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

  • 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.

  • v-menakakota's avatar
    v-menakakota
    Community Support

    Hi Anonymous ,

    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

    • v-menakakota's avatar
      v-menakakota
      Community Support

      Hi Anonymous ,

      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.

      • v-menakakota's avatar
        v-menakakota
        Community Support

        Hi Anonymous ,

        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.