Forum Discussion

FXGE310's avatar
FXGE310
Regular Visitor
6 years ago

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

  • CoreyP's avatar
    CoreyP
    Solution Sage

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

     

    Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    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