Forum Discussion

WimBi's avatar
WimBi
Frequent Visitor
4 years ago
Solved

Performance DAX measure

Hi!
 
I have a question about how i can increase the time my measure takes to calculate.
This measure calculates the difference of the revenue ("Omzet" in Dutch) of this year with last year. At the moment the measure takes around 3 seconds to calculate, but I am wondering if it is possible to increase the speed of the measure.
 
The measure:
 

 

Omzet totaal I LY = 
VAR CY = 
    [Omzet totaal I]
VAR DC = 
    DISTINCTCOUNT(m_revenue_invoices_gaston[YearDate])
VAR LY = 
    CALCULATE([Omzet totaal I],PARALLELPERIOD(m_revenue_invoices_gaston[factuurdatum],-DC,YEAR))

Return
    (CY - LY) / LY

 

 
The file has around 50k lines of data it needs to calculate. Thanks in advance! - willem
  • I have used this measure in the past to calculate what you want. It works really fast with many rows.

     

    YearOnYear = ((TOTALYTD([Revenue],'Date'[Date]))-(TOTALYTD([Revenue],SAMEPERIODLASTYEAR('Date'[Date]))))

     

2 Replies

  • I have used this measure in the past to calculate what you want. It works really fast with many rows.

     

    YearOnYear = ((TOTALYTD([Revenue],'Date'[Date]))-(TOTALYTD([Revenue],SAMEPERIODLASTYEAR('Date'[Date]))))

     

  • v-yadongf-msft's avatar
    v-yadongf-msft
    Community Support

    Hi WimBi ,

     

    Has your problem solved? If solved, please consider Accept it as the solution to help the other members find it more quickly.