Forum Discussion

stibra's avatar
stibra
Frequent Visitor
7 years ago
Solved

Currency calculation

Hi,   I am looking for a formula to convert values with corresponding currency into a new column which shows all values in NOK. See example below:   Value1  Currency   ValueNOK 100       USD    ...
  • Thim's avatar
    7 years ago

    One way is just to keep on stacking if formulas for each currency code you have.

     

    Example.

    ValueNOK = IF('Table'[Currency]="USD";'Table'[Value1]*7,96;
    IF('Table'[Currency]="EUR";'Table'[Value1]*10;
    IF('Table'[Currency]="NOK";'Table'[Value1];0)
    )
    )
     
    But this quickly gets messy, and can be difficult to update the currency.
     
    I would instead make a new table and add currency codes and their values. Just click enter data, and start typing.
     CurrencyValue
    USD7,96
    EUR10
    NOK1
    Then you can use lookupvalue to find the correct currency.
    Something like this.
    Value NOK = LOOKUPVALUE('Currency Table'[Value];'Currency Table'[Currency];'Table'[Currency])*'Table'[Value1]