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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

SUM Where clause across different tables

Hi, 

 

I need to create a new measure withim my 'comp_spend' table whereby it sums the total value based on whether or not a flag = 'Y' across 3 different tables. 

 

Example logic that I am trying to achieve:

 

Total_value_removed = calculate(sum(comp_spend[comp_value]), 'app_new'[remove_flag]="Y" OR 'app_old'[remove_flag]="Y" OR 'app_changed'[remove_flag]="Y")))

 

The 3 tables app_new, app_old and app_changed have all been joined onto the comp_spend table. 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You should just be able to change the OR to ||

Total_value_removed =
CALCULATE (
    SUM ( comp_spend[comp_value] ),
    'app_new'[remove_flag] = "Y"
        || 'app_old'[remove_flag] = "Y"
        || 'app_changed'[remove_flag] = "Y"
)

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

You should just be able to change the OR to ||

Total_value_removed =
CALCULATE (
    SUM ( comp_spend[comp_value] ),
    'app_new'[remove_flag] = "Y"
        || 'app_old'[remove_flag] = "Y"
        || 'app_changed'[remove_flag] = "Y"
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.