Forum Discussion
Need help dealing with multiple currency and converting them
- Anonymous5 years ago
Hi ifenek
I think your currid: CAN in VW_Currency Table should be CAD, or we can't find CAD in VW_Currency Table.
You can achieve your goal by measure.
Measure:
Measure = VAR _SelectID = SELECTEDVALUE ( VW_Currency[currid] ) VAR _PerRate = SUMX ( FILTER ( ALL ( VW_Currency ), VW_Currency[currid] = MAX ( VW_Orders[CurrencyID] ) ), VW_Currency[currate] ) VAR _SelRate = SUMX ( FILTER ( ALL ( VW_Currency ), VW_Currency[currid] = _SelectID ), VW_Currency[currate] ) VAR _GBPhomenett = DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate ) VAR _Selhomenett = DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate ) * _SelRate RETURN IF ( ISFILTERED ( VW_Currency[curdesc] ), _Selhomenett, _GBPhomenett )M.homenett = SUMX(VW_Orders,[Measure])Build a measure to show the currency format.
Currency = IF(ISFILTERED(VW_Currency[curdesc]),SELECTEDVALUE(VW_Currency[curdesc]),"GBP")Result is as below.
By default if the slicer is unfiltered, it will show homenett in GBP.
Select USD.
You can download the pbix file from this link: Sample
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
parry2k Thank you.
I've attached a sample file with what i described on the first post
https://wetransfer.com/downloads/b94ea72acfcd0a9d88d69c0b77526be020201217173718/277ef3
Hi ifenek
I think your currid: CAN in VW_Currency Table should be CAD, or we can't find CAD in VW_Currency Table.
You can achieve your goal by measure.
Measure:
Measure =
VAR _SelectID =
SELECTEDVALUE ( VW_Currency[currid] )
VAR _PerRate =
SUMX (
FILTER (
ALL ( VW_Currency ),
VW_Currency[currid] = MAX ( VW_Orders[CurrencyID] )
),
VW_Currency[currate]
)
VAR _SelRate =
SUMX (
FILTER ( ALL ( VW_Currency ), VW_Currency[currid] = _SelectID ),
VW_Currency[currate]
)
VAR _GBPhomenett =
DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate )
VAR _Selhomenett =
DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate ) * _SelRate
RETURN
IF ( ISFILTERED ( VW_Currency[curdesc] ), _Selhomenett, _GBPhomenett )M.homenett = SUMX(VW_Orders,[Measure])
Build a measure to show the currency format.
Currency =
IF(ISFILTERED(VW_Currency[curdesc]),SELECTEDVALUE(VW_Currency[curdesc]),"GBP")
Result is as below.
By default if the slicer is unfiltered, it will show homenett in GBP.
Select USD.
You can download the pbix file from this link: Sample
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- ifenek5 years agoFrequent Visitor
Hi, Anonymous Thank you for you reply And apology for late reply.
It looks like your solution fits my needs. I'll have a look on your file!
Thank you a lot for your help and happy new year!