Forum Discussion
How to SUMX value with Fixed Exchange%
Hi, I am trying to SUM a value with multiple exchange% conversion and using the following formula.
Currency Format = LASTNONBLANK ('Currency Format'[Format], 1 )
FixedFXTotalPrice = SUMX('Table','Table'[Sales Price]*
IF([Currency Format]='Table'[Currency],"1",
(Lookupvalue('FX Table'[Exchange Rate],
'FX table'[From Currency],'Table'[Currency],
'FX Table'[To Currency],[Currency Format]))))
It works. However, I would like to add one more cretiria that I hope the conversion of exchange% is based on date.
For example, I hope it will take '115' when the sales date after 1/8/2019 and take '117' when sales date between 1/7/2018 & 1/8/2019
| To Currency | Exchange Rate | Delivery Date | From Currency |
| JPY | 115 | 1/8/2019 | USD |
| JPY | 117 | 1/7/2018 | USD |
Please help suggest how I could adjust the formula that it could calculate the Total Price with a Dynamic date.
Here is the raw data,
FX table
| To Currency | Exchange Rate | Delivery Date | From Currency |
| JPY | 115 | 1/8/2019 | USD |
| HKD | 7.75 | 1/8/2019 | USD |
| JPY | 1 | 1/8/2019 | JPY |
| HKD | 0.03 | 1/8/2019 | JPY |
| JPY | 117 | 1/7/2018 | USD |
| HKD | 7.76 | 1/7/2018 | USD |
| JPY | 1 | 1/7/2018 | JPY |
| HKD | 0.035 | 1/7/2018 | JPY |
Table
| Delivery Date | Sales Price | Currency |
| 6/5/2020 | 11110.4 | JPY |
| 8/4/2019 | 2.4 | USD |
| 12/10/2018 | 5112 | JPY |
| 10/8/2020 | 920.1 | USD |
Currency Format
| Format | FormatName | Index | New_Format |
| HKD | HKD | 6 | $#,##0;($#,##0) |
| JPY | JPY | 8 | ¥#,##0;(¥#,##0) |
| USD | USD | 13 | $#,##0;($#,##0) |
4 Replies
- lbendlin
Super User
I assume both your transactions table and your FX table are linked in from the dates/calendar table?
- ngct1112
Post Patron
lbendlin There are only these 3 tables. I have attached the link which you may take a look.
I didn't add the complete FX rate in the FX table in thisThe current version since it may crash somehow.
Great thanks with your help!
https://drive.google.com/file/d/1zcFtEALJ-43rpeTtidewDBjY4lCTNfXK/view?usp=sharing
- lbendlin
Super User
You have no data model, just the unconnected tables. Do you want to keep it like that or do you want to use a data model?