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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors