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
AmudhaKumaran
Helper I
Helper I

SUM based on multiple filters from different tables

Hi Team,

 

I'm trying to find SUM based on filters from multiple tables that are connected in model.

 

SUM1 =

    CALCULATE (

        SUM (Table1[Col1] ),

        Table1[Color] IN { "Red", "Yellow" }       

       ,Table2[Type] IN { "Fruit","Vegetable"}

    )

 

But in this formula, filter from Table2 is not being applied. Please help with the right formula. 

2 ACCEPTED SOLUTIONS
PC2790
Community Champion
Community Champion

Hello @AmudhaKumaran ,

 

If  Table 1 and Table 2 have any relationship between the two, you can try using RELATED DAX to apply the filter on Table 2.

Just found a very useful video targetting the same problem:

https://www.youtube.com/watch?v=Wu1mWxR23jU

See if this helps.

View solution in original post

v-cazheng-msft
Community Support
Community Support

Hi @AmudhaKumaran 

If you want the filters from table2 to filter table1, there must be a relationship path to pass these filters to table1. You can check the relationships in your model to make sure there is a path can pass filters from table2 to table1. Then your dax formula can works well.

 

v-cazheng-msft_0-1617002416305.png

 

v-cazheng-msft_1-1617002416307.png

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? 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

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @AmudhaKumaran 

If you want the filters from table2 to filter table1, there must be a relationship path to pass these filters to table1. You can check the relationships in your model to make sure there is a path can pass filters from table2 to table1. Then your dax formula can works well.

 

v-cazheng-msft_0-1617002416305.png

 

v-cazheng-msft_1-1617002416307.png

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

PC2790
Community Champion
Community Champion

Hello @AmudhaKumaran ,

 

If  Table 1 and Table 2 have any relationship between the two, you can try using RELATED DAX to apply the filter on Table 2.

Just found a very useful video targetting the same problem:

https://www.youtube.com/watch?v=Wu1mWxR23jU

See if this helps.

If using a measure TREATAS is a better option. I think you need a relationship between the tables but it doesn't need to be active.

An example

SalesAmountFiltered =
CALCULATE (
SUM ( Sales[SalesAmount] ),
TREATAS (
VALUES ( Products[Color] ),
Sales[ProductColor]
)
)

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.