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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
powerbityro
Helper II
Helper II

group by two columns from two tables

hi all,

 

how can i use GROUP BY when i want to group by two columns from two different tables?

 

For example i need one measure to group by colum1 and column2:

GROUP(Table1, Table1[Column1])

GROUP(Table2, Table2[Column2])

 

finally i want to count over these new table.

 

many thanks

3 REPLIES 3
Anonymous
Not applicable

HI @powerbityro ,

Unfortunately, groupby function does not allow you to use multiple table columns, you can only use one table which defined in the function table parameter.

You can consider using SUMMARIZECOLUMNS function, it allows you to group records based on different table fields.

SUMMARIZECOLUMNS

Regards,

Xiaoxin Sheng

hi thanks for the advice.

 

how can i use SUMMARIZECOLUMNS to count the number of records grouped by two columns?

Anonymous
Not applicable

HI @powerbityro ,

Do your tables contain relationship mapping? If not, you can't get the correct calculation result based on multiple table column groups. 

If you confused about coding formula, please share some sample data for test.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors