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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
szczepaneq
Regular Visitor

Merging queries - incorrect value after expand table

Hello,

 

After merging 2 queries, I see that the value is correct and expected in the table view as below:

 

szczepaneq_0-1636549534685.png

 

But just after expanding tables I see different value (not match and incorrect - 2022-06-20 instead of 2021-11-08) in the same row as below:

szczepaneq_1-1636549639605.png

 

How is it possible and what am I doing wrong? Thanks for any reply!

 

9 REPLIES 9
TomekPieto
New Member

Hello all,

I had the same.

 

In my case the reason was a step before merging: Sort ascending.

It seams like excel is having a bag whenever you sort the columns. The same is happening with the formulas in a table in a worksheet, if you sort in DESC or ASC order a randm column.

Once I removed the sorting, the merging was working properly.


Syndicate_Admin
Administrator
Administrator

Same issue here. That make no sense, but what I noticed is that matching by dates may have something with this. I'll transform dates to text and then merge and expand. 

I got it!. Not sure what causing it and I had no luck with it changing dates to text or combining key columns into one and then merge by new column. Finaly as the issue was caused by expanding nested table, I've tried Table.Join function instead of Table.NestedJoin which is used when we merge using Merge tool from the ribbon. Difference is that Table.Join creates table with expanded all columns from both merged tables. It does not create a new column with nested table. Downside is that you need to handle column name duplicates between two tables but that's clearly explained in the function documentation which can be found here.

v-eqin-msft
Community Support
Community Support

Hi @szczepaneq ,

 

It's weird.🤔

Could you please share your pbix file after removing sensitive data?

 


Best Regards,
Eyelyn Qin

BA_Pete
Super User
Super User

Hi @szczepaneq ,

 

Can you select your query, go to Home tab > Advanced Editor, copy all the code in there and paste it into a code window ( </> icon above) here please?

I need to be able to see the code that has created the join.

 

Thanks,

 

Pete



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

Proud to be a Datanaut!




Sure,

let
    Źródło = Table.NestedJoin(#"Calesco PO - ilość szt >0", {"PO & PO line ID"}, #"SO OBR - ilość szt >0", {"PO & PO line ID"}, "SO OBR - ilość szt >0", JoinKind.LeftOuter),
    #"Przefiltrowano wiersze" = Table.SelectRows(Źródło, each ([Purchase order] = "123744")),
    #"Usunięto inne kolumny" = Table.SelectColumns(#"Przefiltrowano wiersze",{"Vendor account", "Purchase order", "PO line ID", "PO & PO line ID", "Delivery date ", "SO OBR - ilość szt >0"})
in
    #"Usunięto inne kolumny"

 

Hi @szczepaneq ,

 

Is there a reason why you're doing row filters and column selection before expanding your merge?

I'm not sure whether this would actually cause a problem, but it seems unorthodox to do things this way round.

What happens if you apply this code to a new blank query?

let
    Źródło = Table.NestedJoin(#"Calesco PO - ilość szt >0", {"PO & PO line ID"}, #"SO OBR - ilość szt >0", {"PO & PO line ID"}, "SO OBR - ilość szt >0", JoinKind.LeftOuter),
    expandMerge = Table.ExpandTableColumn(Źródło, "SO OBR - ilość szt >0", {"PO & PO line ID", "Data dostawy"}, {"PO & PO line ID_2", "Data dostawy_2"}),
    #"Przefiltrowano wiersze" = Table.SelectRows(expandMerge, each ([Purchase order] = "123744")),
    #"Usunięto inne kolumny" = Table.SelectColumns(#"Przefiltrowano wiersze",{"Vendor account", "Purchase order", "PO line ID", "PO & PO line ID", "Delivery date ", "SO OBR - ilość szt >0"})
in
    #"Usunięto inne kolumny"

 

Pete



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

Proud to be a Datanaut!




I did some filters to describe simple example. Without any filters, I have the same result. (correct value before expand, and another one - incorrect after expand).

 

before expand:

szczepaneq_0-1636697394259.png

 

after:

szczepaneq_1-1636697487622.png

 

 

Hello!

Did you find any solution? I'm having the same error and I'm going crazy 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors