Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculated Dax column

Hi   I am trying to create a new calculated column in Table 1 in which based on the Invoice Currency and FY then the value is multiplied by the relevant currency rate within Table 2.  Table 3 show...
  • AlB's avatar
    5 years ago

    Hi Anonymous 

    Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

     

    Create a new  calculated table, Table3:

    Table3 =
    ADDCOLUMNS (
        Table1,
        "FValue",
            VAR rate_ =
                LOOKUPVALUE (
                    Table2[Curreny Rate],
                    Table2[Financial Year], Table1[FY],
                    Table2[Currency], Table1[Invoice Currency]
                )
            RETURN
                Table1[Value] * rate_
    )

    You could also just add a calculated column to your Table1 instead of creating a new table

    This can also be done in Power Query.

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers