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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
noyesae
Regular Visitor

Identifying Results of a Power Query

Hello

 

The subject I chose for this is probably bad so I apologize for that.  I have a table with part numbers and the locations that those part numbers are stored in the warehouse.  I created a power query for the off the location column to tell me if that location is a Bin or a Rack.  Now what I want to know is which part numbers are located both in the Bins and the Racks but I'm having a difficult time figuring out just how I should do that.

 

Ultimately the best result would be another column that was a Yes / No for each part number if it was or wasn't stored in both.

 

Any help you can give is appreciate.  Thanks in advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @noyesae 

I build a sample to have a test.

1.png

2.png

Mcode :

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpUitWBsJLALCMgKxnMMobLGkPEYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Number" = _t, Location = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Part Number", Int64.Type}, {"Location", type text}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Location"}, #"Bin or Rack", {"Location"}, "Bin or Rack", JoinKind.LeftOuter),
    #"Expanded Bin or Rack" = Table.ExpandTableColumn(#"Merged Queries", "Bin or Rack", {"Type"}, {"Bin or Rack.Type"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Bin or Rack",{{"Bin or Rack.Type", "Bin or Rack"}}),
    #"Grouped Rows" = Table.Group(#"Renamed Columns", {"Part Number"}, {{"Count", each Table.RowCount(List.Distinct(_[Bin or Rack])), Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each if [Count]=2 then "Yes"else"No"),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Result"}})
in
    #"Renamed Columns1"

Result is as below.

3.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @noyesae 

I build a sample to have a test.

1.png

2.png

Mcode :

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpUitWBsJLALCMgKxnMMobLGkPEYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Number" = _t, Location = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Part Number", Int64.Type}, {"Location", type text}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Location"}, #"Bin or Rack", {"Location"}, "Bin or Rack", JoinKind.LeftOuter),
    #"Expanded Bin or Rack" = Table.ExpandTableColumn(#"Merged Queries", "Bin or Rack", {"Type"}, {"Bin or Rack.Type"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Bin or Rack",{{"Bin or Rack.Type", "Bin or Rack"}}),
    #"Grouped Rows" = Table.Group(#"Renamed Columns", {"Part Number"}, {{"Count", each Table.RowCount(List.Distinct(_[Bin or Rack])), Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each if [Count]=2 then "Yes"else"No"),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Result"}})
in
    #"Renamed Columns1"

Result is as below.

3.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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