Forum Discussion
Cumulative base on 3 column
Hi good day can anyone help me on my calculated column, i need the cumulative sum of Treade base from Area, Week No. and Trade
DESIRED OUTPUT
Thank you
Hi AllanBerces
Try thisCumulative_Trade = CALCULATE( SUM('YourTable'[Weekly_Pl]), FILTER( ALL('YourTable'), 'YourTable'[Area] = EARLIER('YourTable'[Area]) && 'YourTable'[Trade] = EARLIER('YourTable'[Trade]) && 'YourTable'[Week No.] <= EARLIER('YourTable'[Week No.]) ) )Hope this helps, please give a thumbs up and mark as solved if it does, thanks!
Hi AllanBerces
Cum_Trade =
var CurrentArea = [Area]
var CurrentWeek = [Week No.]var Trade = [Trade]
Return
Calculate(
Sum(table[Weekly Plan]),table[Area] = CurrentArea
,table[Week No.] <= CurrentWeektable [Trade] = Trade
)
Capture the current filters into variables and then ask it to sum the target column after adding some filters.
4 Replies
- wardy912Super User
Hi AllanBerces
Try thisCumulative_Trade = CALCULATE( SUM('YourTable'[Weekly_Pl]), FILTER( ALL('YourTable'), 'YourTable'[Area] = EARLIER('YourTable'[Area]) && 'YourTable'[Trade] = EARLIER('YourTable'[Trade]) && 'YourTable'[Week No.] <= EARLIER('YourTable'[Week No.]) ) )Hope this helps, please give a thumbs up and mark as solved if it does, thanks!
- AllanBercesPost Prodigy
Hi wardy912 SamWiseOwl FBergamaschi thank you very much for the reply work perfectly
- SamWiseOwlSuper User
Hi AllanBerces
Cum_Trade =
var CurrentArea = [Area]
var CurrentWeek = [Week No.]var Trade = [Trade]
Return
Calculate(
Sum(table[Weekly Plan]),table[Area] = CurrentArea
,table[Week No.] <= CurrentWeektable [Trade] = Trade
)
Capture the current filters into variables and then ask it to sum the target column after adding some filters. - FBergamaschiSuper User
Your question is unclear to me, can you specify better please giving details of the columns to use and show an example?
Thanks