Forum Discussion
How to SUMX value with Fixed Exchange%
- 6 years ago
Hi ngct1112 ,
Sorry for the late reply!
Create 2 measures as below:
Measure 2 = var _maxdate=TOPN(1,FILTER('FX table','FX table'[Delivery Date]<=MAX('Table'[Delivery Date])),'FX table'[Delivery Date],DESC) Return SUMX(_maxdate,[Exchange Rate])*CALCULATE(SUM('Table'[Sales Price]))Measure 3 = SUMX('Table',[Measure 2])And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi ngct1112 ,
Based on your raw data,could you pls advise me the expected output?And how to calculate it out?
Kelly
I would like to add a slicer on the page using "To Currency" From FX Table
The total calculation is sum by "Sales Price" from Table base on its Delivery Date's FX rate,
When choose JPY in the slicer:
= (11110*1) + (2.4*117) + (5112*1) + (920.1*115) = 122314.3
When choose HKD in the slicer:
= (11110*0.03) + (2.4*7.76) + (5112*0.035) + (920.1*7.75) = 766.619
Do you think it is possible to handle this situation? Great thanks.
Table:
| Delivery Date | Sales Price | Currency |
| 6/5/2020 | 11110 | JPY |
| 8/4/2019 | 2.4 | USD |
| 12/10/2018 | 5112 | JPY |
| 10/8/2020 | 920.1 | USD |
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 |
- v-kelly-msft6 years ago
Community Support
Hi ngct1112 ,
Sorry for the late reply!
Create 2 measures as below:
Measure 2 = var _maxdate=TOPN(1,FILTER('FX table','FX table'[Delivery Date]<=MAX('Table'[Delivery Date])),'FX table'[Delivery Date],DESC) Return SUMX(_maxdate,[Exchange Rate])*CALCULATE(SUM('Table'[Sales Price]))Measure 3 = SUMX('Table',[Measure 2])And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!- ngct11126 years ago
Post Patron
v-kelly-msft , I have tried few testing on my current model and it works smoothly and acuately.
And the formula you suggested could even convert FX% according to >2 designated Date.
Appreciated with your help!
- ngct11126 years ago
Post Patron
Hi v-kelly-msft , may I have a little further question on this solution?
This solution has been working very well. Yet, I am trying to add one more table to cacalute the other converted Price.
I found them not possible to have relationship with both 1.)FX table & 2.)Date table at the same time as below
Do you have any idea how it could be possble linking them to a "Date table" to make a Date slicer in this situation?
Great thanks!!
https://drive.google.com/file/d/1zw0ZHpCDoo0ucQzrvcQADN1Nr_9iF96g/view?usp=sharing