Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
For FactSales, you may use SUMMARIZE Function or GROUPBY Function to perform aggregation first.
User | Count |
---|---|
106 | |
89 | |
82 | |
76 | |
73 |
User | Count |
---|---|
112 | |
103 | |
96 | |
74 | |
67 |