Forum Discussion

nnouchi's avatar
nnouchi
Icon for Helper I rankHelper I
7 years ago
Solved

Calculate the difference in change % between a currency value over a time period

Greetings,   I'm looking to calculate the % difference of change of a exchange rate between dates.   My table structure is the following: Is it possible to calculate the % change between eac...
  • v-yulgu-msft's avatar
    7 years ago

    Hi nnouchi,

     

    Please try this measure:

    % diff =
    VAR currentmonthval =
        SUM ( 'Currency rates'[Value.CAD] )
    VAR previousmonthval =
        CALCULATE (
            SUM ( 'Currency rates'[Value.CAD] ),
            FILTER (
                ALLSELECTED ( 'Currency rates'[Dates] ),
                MONTH ( 'Currency rates'[Dates] )
                    = MONTH ( MAX ( 'Currency rates'[Dates] ) ) - 1
            )
        )
    RETURN
        DIVIDE ( currentmonthval - previousmonthval, currentmonthval )

    Best regards,

    Yuliana Gu