Forum Discussion
Cuurncy conversion
- Anonymous1 year ago
lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:
Hi Gurpreetsingh1 ,Here are the steps you can follow:
1. Create a table that contains the exchange rates for each currency relative to your desired base currency (e.g., USD or CAD).
2. Create measure.
USRate = var _rate=MINX(FILTER(ALL('RateTable'),'RateTable'[CurrencyA]=MAX('Table'[Point])&&[Convert CurrencyB]="US"),[Conversion rate]) return SUMX( FILTER(ALL('Table'),'Table'[Point]=MAX('Table'[Point])),[Sales]) * _rateCARate = var _rate=MINX(FILTER(ALL('RateTable'),'RateTable'[CurrencyA]=MAX('Table'[Point])&&[Convert CurrencyB]="CA"),[Conversion rate]) return SUMX( FILTER(ALL('Table'),'Table'[Point]=MAX('Table'[Point])),[Sales]) * _rate3. Result:
If the results above don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
lbendlin , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution:
Hi Gurpreetsingh1 ,
Here are the steps you can follow:
1. Create a table that contains the exchange rates for each currency relative to your desired base currency (e.g., USD or CAD).
2. Create measure.
USRate =
var _rate=MINX(FILTER(ALL('RateTable'),'RateTable'[CurrencyA]=MAX('Table'[Point])&&[Convert CurrencyB]="US"),[Conversion rate])
return
SUMX(
FILTER(ALL('Table'),'Table'[Point]=MAX('Table'[Point])),[Sales])
*
_rateCARate =
var _rate=MINX(FILTER(ALL('RateTable'),'RateTable'[CurrencyA]=MAX('Table'[Point])&&[Convert CurrencyB]="CA"),[Conversion rate])
return
SUMX(
FILTER(ALL('Table'),'Table'[Point]=MAX('Table'[Point])),[Sales])
*
_rate
3. Result:
If the results above don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for the solution