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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FXGE310
Regular Visitor

If then statement multiple tables

I am trying to calculate a Sum of a column based on two conditions from two different tables. 

Condition 1:

  • Table 1: 'Product Catalog' 
  • Column: 'Treatment Impact' 
  • Value needed form the colum is "Water" 

Conditon 2:

  • Table 2: 'Cost Element' 
  • Column 2: 'Cost Subcategory'
  • Value needed is "Treating-Water" 

Sum Table 

  •  Table: OpEX Detail
  • Column: 'Amount'

I need both of those conditions met to then calculate the sum. Please let me know if is possible. 

This wa sone of my attempts that did not work: 

Water OpEx Total $ = CALCULATE(SUM('OpEx Detail'[Amount]),FILTER('Product Catalog','Product Catalog'[Treatment Impact]="Water"),FILTER('Cost Element','Cost Element'[Cost Subcategory]="Treating-Water"))
2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@FXGE310 

The problem is the relationships between the three tables. For now, you can try used related and relatedtable function to referent the filters depend on your relationship. 

For absolute solution, we would need your sample pbix file including relationship.

Best,
Paul

CoreyP
Solution Sage
Solution Sage

Can you post sample data from all of your tables and indicate if there are any relationships present?

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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