Forum Discussion

shaunwilks's avatar
shaunwilks
Helper V
8 years ago
Solved

Cumulative/Running Balance in a Matrix

Hello All,   Would appreciate any assistance on this if possible.   I would like to know who to write a DAX measure that gets the last of the cumulative figures for a period, but then totals all ...
  • shaunwilks's avatar
    shaunwilks
    8 years ago

    Thanks for that - I have never used SUMMARIZE before so will do some work and investigation into it.

     

    I think I found a wokraround for my problem in the header.

     

    I added an index to the table thats sorted by date.

    I then added a column that retrieved the MAX Index for rows in the table with the the same period (ie month).

    That means I have the index number of the very last record in the month for the fact table and primary key.

     

    Another column is a simple IF statement that sets the value of the field to the running balance value IF the index of that record is the last index id of rows in the same period else set 0.00.

     

    I therefore end with the running balance, set only in the last record on the month.

    When its dropped into a matrix it sums up perfectly.

    I think I may now do the same for the QTR, and use your ISFILTERED Suggestion to show the QTR value if filtered by qtr and month if filtered by month.

     

    Thanks for all your assistance,