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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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