For this video we will look at building a solution around currencies. We will try and find a way allowing the user to view either all currencies in their right formatting or exchange the values to a currency of choice.
Symbol = SWITCH ( SELECTEDVALUE ( 'Conversion Slicer'[Code] ), "1", LOOKUPVALUE ( 'Exchange Rates'[Currency symbol], 'Exchange Rates'[Currency Exchange Code], SELECTEDVALUE ( 'Currency Symbols'[Currency code] ) ), "0", LOOKUPVALUE ( 'Exchange Rates'[Currency symbol], 'Exchange Rates'[Currency Exchange Code], SELECTEDVALUE ( 'Contoso Sales'[Currency Code] ) ) )
Exchange Rate to Eur = LOOKUPVALUE ( 'Exchange Rates'[Exchange Rate], 'Exchange Rates'[Currency Exchange Code], SELECTEDVALUE ( 'Contoso Sales'[Currency Code] ) )
Exchange Rate = LOOKUPVALUE ( 'Exchange Rates'[Exchange Rate], 'Exchange Rates'[Currency Exchange Code], SELECTEDVALUE ( 'Currency Symbols'[Currency code] ) )
Total = VAR ExRateFromEuro = [Exchange Rate] VAR Cost = CALCULATE ( SUM ( 'Contoso Sales'[Total Cost] ) ) VAR Exchange = SELECTEDVALUE ( 'Conversion Slicer'[Code] ) VAR ExchangeToEuro = SUMX ( 'Contoso Sales', DIVIDE ( 'Contoso Sales'[Total Cost], [Exchange Rate to Eur] ) ) RETURN SWITCH ( Exchange, "1", ExchangeToEuro * ExRateFromEuro, "0", Cost )