Forum Discussion
Apply Exchange Rates to Local Currency button
- Anonymous5 years ago
Hi Fro88er ,
Please update the formula of measure as below:
Temp Revenue (selected currency) = VAR _selcurrency = SELECTEDVALUE ( 'DimCurrency'[Currency] ) VAR _currate = CALCULATE ( MAX ( 'DimCurrency'[Currency Rate] ), 'DimCurrency'[Currency] = _selcurrency ) RETURN IF ( _selcurrency = "CAD" && MAX ( 'Fact1Staff Consolidated GP'[Region] ) = "Toronto", [Temp Revenue (local)] * _currate, [Temp Revenue (local)] )Best Regards
Rena
Fro88er - I had to read this through a few times. Sample data would have helped to make this clearer. However, if I understand correctly, you want to implement a currency conversion for non-US cities. If that is the case you could do this:
Temp Revenue (selected currency) =
VAR __SelectedCurrency = [Selected Currency]
VAR __CityCurrency = MAX('Fact1StaffConsolidatedGP'[CurrencyID])
VAR __Rate = MAX('Currency Table'[Currency Rate])
RETURN
IF(__SelectedCurrency = __CityCurrency,[Temp Revenue (local)]*__Rate,[Temp Revenue (local)])I am have the meaure working with the variable [Temp Revenue (selected currency)] but the total do not match. When I write a seperate measure [Temp Revenue Test] the numbers and totals match. However, when I try and add/merge into only 1 measure, the [Temp Revenue (selected currency)] that includes the variables with a Sumx function the totals don't match either, what am I doing wrong?
- Greg_Deckler5 years agoCommunity Champion
Fro88er This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907Sorry I lost track of this, I don't check my messages on this site very often!!