Forum Discussion

wsmaguire's avatar
wsmaguire
New Member
6 years ago
Solved

Cumulative total across a row

Hi All;

 

Relatively new to PowerBI here, and struggling....

I am trying to show a cumulative cash flow over time across a row. I see many options for cumulative totals down a column, but I need a row:

Name                    Jan             Feb              Mar

Project 1                 10               10                 5

Project 2                   7                -3                 6

Total                       17                 7                11

Cumulative             17                 24              35 <---- How do I create this row??

 

I am hopeful, but my optimism is waning....    

  • Hi wsmaguire,

    You could change data structure by M code and add a Total row in it, then use measure to calculate cumulative value. You could refer to my sample for details.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Hey wsmaguire ,

     

    I recommend that you transform your data structure from a wide format (a column for each month) into a long format (two columns that form a key value pair: month column and value column), but maybe this is just a misunderstanding as you used the wide format for better visualizing your requirement.

     

    This site https://www.daxpatterns.com/time-patterns/ contains almost anything that's necessary to create time and date related calculations using DAX.

     

    Regards,

    Tom

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi wsmaguire,

    You could change data structure by M code and add a Total row in it, then use measure to calculate cumulative value. You could refer to my sample for details.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.