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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
zipke
Helper I
Helper I

Summarize multiple tables in DAX

Hi all,

 

How can I summarize multiple tables in DAX?

 

I have multiple tables I want to combine and summarize in DAX, how can I do this?

I have Table1, 2 and 3.

 

I Summarize Table1 with this code:

New Table = 
SUMMARIZE(
    'Table1',
    'Table1'[Column1],
    'Table1'[Column2]
)

How can I add the columns from Tables 2 and 3 I want to add?

They are all linked with relationships. I have a table in the dashboard combining all of them in one big table, but as there are over 700k lines, I need them in DAX to export with DAX Studio...

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@zipke ,


According to your description, my understanding is that you want to combine columns from multiple tables and summarize them, in this scenario, we can first use the addcolumns function to combine them, then use the summarize function to summarize them. Please refer to the following example:

Table = 
var combinetable = ADDCOLUMNS('Production Products',"CateGory Desc",RELATED('Production Categories'[description]),"ProviderName",RELATED('Production Suppliers'[companyname]))
return 
SUMMARIZE(combinetable,[CateGory Desc],[ProviderName],'Production Products'[productname],'Production Products'[unitprice])

The result will like below:
1.png

 

If the above DAX doesn’t help, pleases share sample data of your tables and post expected result.



Regards,
Lydia

Community Support Team _ Lydia Zhang
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

5 REPLIES 5
RZAU
Frequent Visitor

I think if the table 1, 2, 3 have relateionships. You could also
Summarize(

'Table1',
'Table 1 [Column 1],
'Table 2 [Column 1],
'Table 3 [Column 2]....
)

 

what if the tables are indirectly connected ? how can we summerize then ?
I have three tables two tables are directly connected , one is indirectly connected how can we tackle that sort of scenario ?

v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@zipke ,


According to your description, my understanding is that you want to combine columns from multiple tables and summarize them, in this scenario, we can first use the addcolumns function to combine them, then use the summarize function to summarize them. Please refer to the following example:

Table = 
var combinetable = ADDCOLUMNS('Production Products',"CateGory Desc",RELATED('Production Categories'[description]),"ProviderName",RELATED('Production Suppliers'[companyname]))
return 
SUMMARIZE(combinetable,[CateGory Desc],[ProviderName],'Production Products'[productname],'Production Products'[unitprice])

The result will like below:
1.png

 

If the above DAX doesn’t help, pleases share sample data of your tables and post expected result.



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

What if i have a relationship like one-many , so which function to use instead of "Related" Dax??

Hi @v-yuezhe-msft 

 

Sorry for the late reply. I just tested it and it works like a charm! Thanks a bunch!!

 

Can I add filters to this DAX as well? E.g. I have a column with "Status" and it should be [Status]>20.

Where can I add this to the code?

 

Thanks a lot in advance!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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