Forum Discussion
Kevin-Mann
Advocate I
8 years agoPRODUCTX 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...
- 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
v-jiascu-msft
Microsoft Employee
8 years agoHi 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
Kevin-Mann
Advocate I
8 years agoYou know, I think my output was correct to begin with. I'll give you credit anyhow. Thanks!