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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors