Forum Discussion

CanberkAcikbas's avatar
CanberkAcikbas
Regular Visitor
2 years ago
Solved

Calculated New Currency column based on two tables

Calculated New Currency column based on two tables   First table consists of   Value of an Item(integer) like 100 Currency (string) like EUR , PLN, SEK Invoice date (date) like yyyy/mm  ...
  • ITManuel's avatar
    2 years ago

    Hi CanberkAcikbas ,

     

    you can try the following code for a new calculated column in Table 1. 

    AmountEUR = 
    VAR _XChangeRate =
        LOOKUPVALUE (
            Table2[XChangeRate],
            Table2[COD1], Table1[Currency],
            Table2[Date], Table1[InvoiceDate]
        )
    VAR _Result =
        IF ( Table1[Currency] = "EUR", Table1[Item], Table1[Item] * _XChangeRate )
    RETURN
        _Result

     

    Br