Forum Discussion

Reddyp's avatar
Reddyp
Helper I
4 years ago

Group sum/cumulative total/Running total

Calculate group sum whn you have 2 or more categories

Final output: Group sum is calculated based on categories 


Process:
1. Upload data > transform data > Add column > Index Column > From 1 
you will see index colum in your data, save and close 
2. Load data into "Data" colum in power BI, 
From "Fileds" > Add "New Column > use Dax code mentioned below 

Group sum =
SUMX (FILTER (
'ABC - LW6',
EARLIER ( 'ABC - LW6'[Category] ) = 'ABC - LW6'[Category]
&& EARLIER ( 'ABC - LW6'[Index] ) >= 'ABC - LW6'[Index]), 'ABC - LW6'[total sales1])

Result: 

 


 

1 Reply

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Reddyp 

     

    Thank you for sharing your solution and experience with the community!

     

    Best Regards,
    Community Support Team _ Jing