Forum Discussion
nnouchi
Helper I
7 years agoCalculate 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...
- 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
v-yulgu-msft
Microsoft Employee
7 years agoHi 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
nnouchi
Helper I
7 years agoThank you, this is exactly what I was looking to accomplish.