Forum Discussion

deepakb18's avatar
deepakb18
Icon for Helper I rankHelper I
8 years ago
Solved

Change the calculation to all page based on User Input

Hi Experts   I have one requirement. I have one table that contains Accont Number, Amount, Amount Currency as below     Now I need to take user input of exchange rate for USD, EUR from use...
  • MFelix's avatar
    MFelix
    8 years ago

    Hi deepakb18,

     

    On Dax you can use a SWITCH function that is a supersize IF that allow to make several IF, check the link with the explanation.

     

    Regarding your formula using the above syntax you should use the following:

     

    TOTAL Value =
    SWITCH (
        TRUE ();
        MAX ( Table[Account_Currency] ) = "USD"; SUM ( 'Total Population'[Account Balance Value Reported] )
            * MAX ( Rate_USD[Rate_USD Value] );
        MAX ( Table[Account_Currency] ) = "EUR"; SUM ( 'Total Population'[Account Balance Value Reported] )
            * MAX ( Rate_USD[Rate_EUR Value] );
        SUM ( 'Total Population'[Account Balance Value Reported] )
    )

    You should add the as many parameter as table you need the last one is the If nothing of the above happens returns in this case I return the actuals value.

     

    This is the values you should increment in each of your exchange rate (change AAA by your exchange rate):

    MAX ( Table[Account_Currency] ) = "AAA"; SUM ( 'Total Population'[Account Balance Value Reported] )
            * MAX ( Rate_AAA[Rate_AAA Value] )

     

    Regards,

    MFelix