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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Ashish84
New Member

Combine multi currency daily Sales with EOM Exchange Rates of User selected Currency

Hi , I am looking to get the Sales Amount in the User Selected Currency Slicer value. FactSales has daily transactions in diffirent currencies while the FactExchangeRate table has end of month conversion rate for various FromCurrency to ToCurrency.

 

User will select the FactExchangeRate[ToCurrency] as thier desired reporting currency using a slicer and I have to show revenue in that currency. Below expression doesn't give right results because of different date granualities in the two fact tables. I have added a EndOfMonth column in FactSales but just don't know how to map it to the ExchangeRate table for join.

 

Revenue = IF (
    HASONEVALUE (FactExchangeRate[ToCurrency]),
    CALCULATE (
        SUMX (
              CROSSJOIN (DimCurrency, DimDate),
              CALCULATE ( VALUES (FactExchangeRate[ExchangeRate]) * SUM(FactSales[TrnAmt]))

             ),FactExchangeRate,FactExchangeRate[ToCurrency] = VALUES ( FactExchangeRate[ToCurrency])
    ),
      BLANK ()
    )

 

LOOKUPVALUE() won't work because it is too slow and I have very large 10 mi records in FactSales. I can change the backend DB if any columns are to be added to optimize this conversion in DAX. Any help appreciated.Currency.png

 

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Ashish84,

 

For FactSales, you may use SUMMARIZE Function or GROUPBY Function to perform aggregation first.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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