The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello everyone!
I have a table with exchange rates from Foreign currency to EUR.
What I would like to create is a formula/DAX expression in order to calculate cross-rates (for example USD/CHF) for a defined date.
Here is a simple example:
Let's say I have below table, with data until "Rate" column. I would like to retrieve the CHF rate of 01/01/2017 (0.88) in order to calculate the USD/CHF rate (I guess I would somehow need to use the "divide" and "filter" functions, but I don't know how). Any idea?
Thanks for your help!
Valid from | From | To | Rate | CHF | USD/CHF | |
1/01/2017 | USD | EUR | 0.84 | 0.88 | =0.84/0.88 | |
1/01/2017 | CHF | EUR | 0.88 |
Solved! Go to Solution.
Hi @jopezzo,
You can add a calculate column and use date and currency name to find the specific value:
CHF = LOOKUPVALUE('Currency'[Rate],'Currency'[Valid from],[Valid from],'Currency'[From],"CHF")
Then add a column to calculate the result.
USD/CHF = [Rate]/[CHF]
Regards,
Xiaoxin Sheng
Hi @jopezzo,
You can add a calculate column and use date and currency name to find the specific value:
CHF = LOOKUPVALUE('Currency'[Rate],'Currency'[Valid from],[Valid from],'Currency'[From],"CHF")
Then add a column to calculate the result.
USD/CHF = [Rate]/[CHF]
Regards,
Xiaoxin Sheng
Thanks a lot! That's really great!
User | Count |
---|---|
70 | |
64 | |
61 | |
49 | |
28 |
User | Count |
---|---|
117 | |
81 | |
65 | |
55 | |
43 |