mytabi
mytabi

Reputation: 779

Power BI exchange rate

in Power Bi i have two tables .

Table 1

COUNTRY Sales
CHN 100
JPN 100

Table 2

COUNTRY ToUSD Exchange rate
CHN 7
JPN 135

i have a measures

TOTALSALES = sum(Table1[Sales])

TOTALSALES_USD = ????

I don't want to calculate the value of the USD for each rows .

I want to sum USD for individual country and sum again .

If I choose one country , it will convert the USD for 1 country .

if I choose two country , it will totalsales (CHN) (CHN to USD RATE) + totalsales (JPN) (JPN to USD RATE)

how to write the DAX

TOTALSALES_USD

Upvotes: 0

Views: 39

Answers (1)

Mik
Mik

Reputation: 2103

This works if you have a single Rate value for each country and your tables are linked 1-M.

=
Sumx(
    'Table2'
    ;SumX(
           Relatedtable('Table1')
           ;[Sales])*[ToUSD Exchange rate]
)

Upvotes: 0

Related Questions