Forum Discussion

electrobrit's avatar
electrobrit
Post Patron
3 years ago
Solved

grand total incorrect when using an IF condition

Having issues with  getting matrix grand total correct when using an IF condition that if the district =1001, then sum the secondary currency else sum the local currency. Perhaps using selected value...
  • electrobrit's avatar
    3 years ago

    I figured it out for anyone else dealing with this:

    Actual_Amount =
    SUMX(
       vw_districts,
       CALCULATE(
          SWITCH(
             MAX(vw_districts[District Code]),
             "1001", SUM(vw_fin_transactions[Transaction Amount Secondary]),
             SUM(vw_fin_transactions[Transaction Amount Local]))))