Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ahamawandi
New Member

Sales Coulumn data stored in multiple currencies and I want to convert into a preselected currency

Hi, I am new to PowerBI when it gets to multiple currency dataset 

 

I have a source Sales Transaction table which has a unit_price column, and a currency column shows which currency is the unit_price value in the record.

The requirement is to have a Currency Slicer on the Report page in PBI. Once the Currency is selected, then the unit_price values will be viewed in the selected currency.

In my SSIS package, I populate the currency_rate table which covers all the major currencies (AUD,USD,EUR,etc..) for each day and versus the each of those Currencies on a daily bases from our ERP system. The Schema of this table is :

Transaction_Currency, RateDate, Currency, Rate

Example for its records:

Record_1  : AUD,2019-12-16 00:00:00.000,AUD,1.000

Record_2  : AUD,2019-12-16 00:00:00.000,USD,0.692

Record_3  : AUD,2019-12-16 00:00:00.000,EUR,0.620

Record_4  : AUD,2019-12-16 00:00:00.000,GBP,0.514

Record_5  : AUD,2019-12-16 00:00:00.000,NZD,1.047200

Record_6  : SGD,2019-12-16 00:00:00.000,AUD,1.068

Record_7  : SGD,2019-12-16 00:00:00.000,USD,0.739

Record_8  : SGD,2019-12-16 00:00:00.000,EUR,0.662

Record_9  : SGD,2019-12-16 00:00:00.000,GBP,0.549717

Record_10: SGD,2019-12-16 00:00:00.000,NZD,1.118

Record_11: SGD,2019-12-16 00:00:00.000,SGD,1.000

____________________________________________________________

The Schema for the Sales_Transaction Table is:

Invoice_ID,Invoice_Date,Invoice_Line_Product_S_Key,Currency,Unit_price

Example for its records:

Record_1  : 10465,2019-12-16 00:00:00.000,1,120,AUD,10

Record_2  : 10465,2019-12-16 00:00:00.000,2,125,AUD,30

Record_3  : 10466,2019-12-16 00:00:00.000,1,131,SGD,25

Record_2  : 10466,2019-12-16 00:00:00.000,2,135,SGD,15

 

Both source tables are imported into my PowerBI model as a dataset

And as an example the user selects EUR as a currency from the Currency Slicer, he wants the reports list and charts to show the sales in regardles what the transaction currency is, so that he can get the Total sales correct in the currency he selects.

 

I saw the Video to handle multiple currencies, but in that video the transaction currency is one type not multiple ones like in my case. https://www.youtube.com/watch?v=88QSf2fB1Rg

 

Whoever knows the best way to handle my case , I appreciate if you can share the solution

Thanks

 

Adam

 

 

1 REPLY 1
Anonymous
Not applicable

@ahamawandi Please try below measure to get the unit price in selected currency

Measure = 
VAR _selectedCurrency = SELECTEDVALUE(currency_rate[Currency])
VAR _currentCurrency = MAX(Sales_Transaction[Currency])
VAR _rate = CALCULATE(MAX(currency_rate[Rate]),FILTER(ALL(currency_rate),currency_rate[Currency]=_selectedCurrency&&currency_rate[Transaction_currency] = _currentCurrency))
RETURN SUMX(Sales_Transaction,_rate*Sales_Transaction[Unit_price])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.