Forum Discussion

Kevin-Mann's avatar
Kevin-Mann
Icon for Advocate I rankAdvocate I
8 years ago
Solved

PRODUCTX is not working for Cumulative Return

I am trying to add the filtered return totals for each day and then use the DAX pattern to accumulate returns  (cumulative return).  I've tried several in-line variation of the below code, but nothin...
  • v-jiascu-msft's avatar
    8 years ago

    Hi Kevin-Mann,

     

    It seems you need a number that could be the total of Return. But you didn't write it in the formula. How about the one like below?

    Cumulative Return % = 
    	VAR maxDate = MAX([Return Date])
    	VAR minDate = MIN([Return Date])
    	VAR DAILYSUM = CALCULATETABLE(SUMMARIZE(ALLSELECTED('Dates'), [Return Date], "Ret%", SUM('Exposure And Return'[Return %])), 'Exposure And Return'[Return Date] <= maxDate)   
        Return PRODUCTX(DAILYSUM, [Ret%] * [Return Amount]) 

     

    Best Regards,

    Dale