Forum Discussion

Nino1's avatar
Nino1
Frequent Visitor
4 years ago
Solved

DAX

Hello everyone

 

I'm a new user of Power bi and need your help.

 

I have two tables: one for total revenue and one for exchange rate.

 

datecurrencytotal revenuetotal revenue in USD datecurrencyCurrency Rate
5/31/2022EUR100008000 5/31/2022EUR0.8
5/31/2022USD2000020000 5/31/2022USD1
6/30/2022EUR100009000 6/30/2022EUR0.9
6/30/2022USD2000020000 6/30/2022USD1

I want to calculate difference between currenct revenue in dollar and revenue in dollar adjusted with previous month exchange rate. e.g. (20000+9000) - (20000*1+10000*0.9)

Could you please help me to solve this problem?

Thank you very much!

  • Hi!

    You should use:

    SUM([total revenue])*RELATED([Currency Rate]) - 

    CALCULATE(SUM([revenue total])*RELATED([Currency Rate]) , DATEADD('Calendar'[Date], -1, MONTH))

2 Replies

  • Hi!

    You should use:

    SUM([total revenue])*RELATED([Currency Rate]) - 

    CALCULATE(SUM([revenue total])*RELATED([Currency Rate]) , DATEADD('Calendar'[Date], -1, MONTH))