Forum Discussion
kbabu57
2 years agoRegular Visitor
Cumulative Sum by 2 columns
Hi Folks and Fowmy Jihwan_Kim I have a requirement where i have to get cumulative sum by 2 columns. The below is the sample data The thing is Final Amount is coming by Customer Number and Year ...
- Anonymous2 years ago
Hi kbabu57
Ashish_Mathur Good share!
For your question, here is the method I provided:
Here's some dummy data
"Datas"
You can create a measure. Group by customer number, and add up "Diff" and "Balance Pay".
Final Amount = CALCULATE ( SUM ('Datas'[Price Amt]), FILTER ( ALLEXCEPT ('Datas', 'Datas'[Customer Number]), 'Datas'[Year] = MAX ('Datas'[Year]) ) ) + CALCULATE ( SUM ('Datas'[Diff]), FILTER ( ALLEXCEPT ('Datas', 'Datas'[Customer Number]), 'Datas'[Year] <= MAX ('Datas'[Year]) ) ) - CALCULATE ( SUM ('Datas'[Balance Pay]), FILTER ( ALLEXCEPT ('Datas', 'Datas'[Customer Number]), 'Datas'[Year] <= MAX ('Datas'[Year]) ) )Here is the result
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
kbabu57
2 years agoRegular Visitor
Hi Friends, Could you please help how to write the DAX measure for the above requirement
- Ashish_Mathur2 years ago
Super User
Hi,
PBI file attached.
Hope this helps.