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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
lklenner
Frequent Visitor

Table Join with duplicate values need advice

Good morning,

 

I have a set of data , however, as you would expect when doing a full join, duplicate values are created for missing rows.  The data is correct, but my question is, what is the best way to remove the duplicate values in eQty so that the totals align?  Is there a good way to do this?

 

Screenshot 2021-09-20 104137.png

 

Thanks in advance

2 REPLIES 2
lklenner
Frequent Visitor

Hi @v-yingjl 

 

Thanks for your response, however, this does not work.  These are two seperate tables that are being joined, with a different order and rows.  Creating new indices and merging on them does not work.

 

Below is what I'm using at the moment.

 

let
    Source = Table.NestedJoin(MBOMLookup,
      {
        "Component",
        "Component unit",
        "Proj",
        "MBOMData.EBOM"
      },
      EBOMLookup,
      {
        "Component",
        "Component unit",
        "Proj",
        "EBOMData.Immediate Parent"
      },
      "EBOMLookup",
      JoinKind.FullOuter
),

 

 

 

 

v-yingjl
Community Support
Community Support

Hi @lklenner ,

One of the join kinds available in the Merge dialog box in Power Query is a full outer join, which brings in all the rows from both the left and right tables.

 

If want to get the expected output, need to add an index column in each table, and then use merge based on Component column and Index column.

 

Example:

vyingjl_1-1632361322887.png

vyingjl_2-1632361330937.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgq2cjYytrSwNDBQ0lFyNTAwNDfSNTI2NATyDI30gKKxOthUWRjpmlkaWKKrcrQ0MrIASiPMMjQwMzACKQOrigUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Component = _t, Id = _t, eQty = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Component", type text}, {"Id", type text}, {"eQty", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Merged Queries" = Table.NestedJoin(#"Added Index", {"Component", "Index"}, Table2, {"Component", "Index"}, "Table2", JoinKind.FullOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(#"Merged Queries", "Table2", {"Component", "Id", "eQty"}, {"Table2.Component", "Table2.Id", "Table2.eQty"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Table2",{"Index"}),
    #"Sorted Rows" = Table.Sort(#"Removed Columns",{{"Component", Order.Descending}, {"Table2.Component", Order.Descending}}),
    #"Filled Down" = Table.FillDown(#"Sorted Rows",{"Component", "Table2.Component"})
in
    #"Filled Down"

vyingjl_3-1632361366266.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.