Forum Discussion

fazza1991's avatar
fazza1991
Icon for Helper II rankHelper II
3 years ago

Speed up SUMX formula

Hi All,

 

I need help with speeding up a formula that doesnt sum up correctly, so have to use SUMX to get the correct total.

However this is so slow at loading it times out when on BI server

 

What i am trying to essentially do is work out customers that gave notice and sum the last 12 months worth of revenue linked to a different table. cannot do relationship between two tables on Account Id due to BI not allowing on Many-to-Many etc

 

Formula  below:

 

 

 

Terminated|Revenue|12m = 

VAR TermDate = 
    SELECTEDVALUE ( 'Revenue'[Account_Id]) 


VAR results = 
CALCULATE([Terminated|Revenue],  
      DATESINPERIOD ( 
        'Date'[Date],                 
        EOMONTH ( MAX ( 'Terminated|SF'[Notice]), 0 ), 
        -12,  MONTH),USERELATIONSHIP('Date'[Date],'Terminated|SF'[Notice]))


RETURN

results

 

 

 

 

the sumx and summarize formula:

 

 

 

Terminated|Revenue|12m2 = 

SUMX(
  SUMMARIZE('Terminated|SF',
    'Terminated|SF'[Account_Id],
    'Terminated|SF'[Account_Name],
    'Terminated|SF'[Notice]),
      'Terminated|SF'[Terminated|Revenue|12m])