Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |