Sumx Performance Issue

AlwaysNeedExcelHelp

New Member
Joined
Sep 24, 2019
Messages
6
Hey all,

I'm having some performance issues with Sumx that are causing very slow measure performance as was wondering if you smart people would know of a better way to accomplish these



TestMeasure=

'Take the slicer selection date'
VAR CalculationDate= [SelectedDate]

'Calculate USD values, no need to lookup anything
VAR CalcResult=
CALCULATE (
SUM ( Data[Amount] ),
FILTER ( VALUES ( Data[Currency] ), [Currency] = "USD" ),
FILTER (
VALUES ( Date[Due] ),
&& [Due] <= CalculationDate
))

'Perform NonUSD
+ CALCULATE (
SUMX (
'Data',
(
Data[Amount]
*
'find numerator of exchange rate
LOOKUPVALUE (
FXMarketRates[Multiplier],
FXMarketRates[FromTo], Data[Currency],
FXMarketRates[Eff Date], CalculationDate,
FXMarketRates[Rate Type], "CRRNT"
)
)
/

'find denom of exchange rate
LOOKUPVALUE (
FXMarketRates[Divisor],
FXMarketRates[FromTo], Data[Currency],
FXMarketRates[Eff Date], CalculationDate,
FXMarketRates[Rate Type], "CRRNT"
)
),
FILTER ( VALUES ( Data[Currency] ), [Currency] <> "USD" ),
FILTER (

VALUES ( Data[Due] ), [Due] <= CalculationDate
))

RETURN
IF ( ROUND ( CalcResult, 2 ) <> 0, ROUND ( CalcResult, 2 ) ) + 0
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top