Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Group By data in 2 different sheets

Hi Everyone, I want to use a function similar to SUMIF in excel. I tried many things but I'm unable to do that in power bi as I have 2 sheets of data. I also tried doing GROUPBY but that didn't work...
  • v-jingzhang's avatar
    v-jingzhang
    4 years ago

    Hi Anonymous 

     

    You can use Merge Queries feature to bring data from one table into another table. Select one or multiple matching column pairs in both tables for joining. Column headers don't need to match between tables. However, it's important to note that the columns must be of the same data type, otherwise the merge operation might not yield correct results. For example, 

     

    After selecting OK in the Merge dialog box, a new column will be added to the base table with the same name as your right table. This column holds the values corresponding to the right table on a row-by-row basis. From this new table column, click the expand icon on column header and switch to Aggregate. For the field you want to sum, select Sum aggregation type for it. 

     

    After selecting OK, this field will be sumed up according to the matching columns. 

     

    For detailed guidance, please refer to Merge queries overview 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.