Forum Discussion
Summarize multiple tables in DAX
- Anonymous7 years ago
Anonymous ,
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:
If the above DAX doesn’t help, pleases share sample data of your tables and post expected result.
Regards,
Lydia
Anonymous ,
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:
If the above DAX doesn’t help, pleases share sample data of your tables and post expected result.
Regards,
Lydia
- Anonymous7 years agoNot applicable
Hi Anonymous
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!
- Anonymous5 years agoNot applicable
What if i have a relationship like one-many , so which function to use instead of "Related" Dax??