Forum Discussion

Mic1979's avatar
Mic1979
Icon for Post Partisan rankPost Partisan
1 year ago
Solved

SUMIFS WITH POWER QUERY

Dear all,   I have the following case: In the table "Manifold_Distribution", I need to add a column matching the cell values, for each line, with what is in the table "OVERALL_DISTRIBUTION". I a...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Mic1979 
    Thank you for reaching out microsoft fabric community forum.

    You can use the Table.Group function to get the same result in Power Query. Instead of merging the tables first, you’d start by grouping the OVERALL_DISTRIBUTION table based on all the matching criteria columns like Region, Type, Valve_Function, etc., and summing the Volumes Y3 values for each group.

    To do this, load both tables into Power Query. In OVERALL_DISTRIBUTION, use the Group By option to group by all relevant columns and sum the Volumes Y3 column. Once you have the grouped data, merge it with Manifold_Distribution using the same columns as the matching criteria. Finally, expand the merged table to bring in the summed Volumes Y3 values, and load the data back into Excel.

    This method is more efficient and avoids unnecessary duplication.

    If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
    Thank you.