Forum Discussion

mike_viz_lord's avatar
mike_viz_lord
Frequent Visitor
5 years ago
Solved

How to count rows from another table in Power Query

Table_A is a list of each STATE along with dimensions and measures for each state. Table_B is a list of ATTORNEY_NAME by STATE (one to many relationship). I'm trying to create a custom column in Tabl...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Sorry, that's wrong. THIS will work, and it's easier.

    NewStep=Table.NestedJoin(PreviousStep, {"STATE"}, Table.Distinct(TABLE_2), {"STATE"}, "People", JoinKind.LeftOuter)

     

    Now, instead of Expanding the table column, you can choose Aggregate, select "Count" for either column, and you are done,