Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nnouchi
Helper I
Helper I

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:ER.PNG

Is it possible to calculate the % change between each row in a structure of this kind in Power BI?

 

I have tried this for one single column and have been unfortunately unable to figure this out. Here's my measure I created: 

 
DIVIDE(sum('Currency Rates'[Value.CAD]) - CALCULATE(Sum('Currency Rates'[Value.CAD]),PARALLELPERIOD('Currency Rates'[Dates],-1,MONTH)),SUM('Currency Rates'[Value.CAD]),-1)
 
 
Any help would be greatly appreciated.
Thanks,
 
Nic

 

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, this is exactly what I was looking to accomplish. 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.