Forum Discussion

kumarm's avatar
kumarm
Frequent Visitor
6 years ago

Exchnage rate issue

I have created two measure for exchange rate. One of them is Total Income Transferred - Actual. This works fine when I select any date from dim exchange date. The value calculated is correct.

Total Income Transferred - Actual =
VAR Target_Value =
CALCULATE (
SUMX (
Current
Actual[Total Income transferred lc]
/ LOOKUPVALUE (
'Dim Exchange Rate'[Rate],
'Dim Exchange Rate'[Currency], Actual[LocalCurrrency],
'Dim Exchange Rate'[Date_Sorted], SELECTEDVALUE ( 'Dim Exchange Date'[Date] )
)
)
)
RETURN
IF (
HASONEVALUE ( 'Dim Exchange Date'[Date_Key] ),
Target_Value,
SUM ( Actual[Total Income transferred] )
)
But I have another measure based on same logic but here I am taking lastnonbank value for the measures. But the exchange rate applied is wrong. Can you please help here.
Operational Cost - Report =
VAR LASTNONBLANK_1 =
CALCULATE (
SUM ( Report[Operational Cost] ),
LASTNONBLANK (
'Dim Period'[PeriodDate],
CALCULATE ( SUM ( Report[Operational Cost] ) )
)
)
VAR Target_Value =
CALCULATE (
SUMX (
Report,
[Operational Cost lc - Report]
/ LOOKUPVALUE (
'Dim Exchange Rate'[Rate],
'Dim Exchange Rate'[Currency], Report[LocalCurrency],
'Dim Exchange Rate'[Date_Sorted], SELECTEDVALUE ( 'Dim Exchange Date'[Date] )
)
)
)

RETURN
IF (
HASONEVALUE ( 'Dim Exchange Date'[Date_Key] ),
Target_Value,
LASTNONBLANK_1
)
Thanks
Manoj

6 Replies