Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Cumulative totals (rows)

Hello  -  I have a date table.    I have put the following measure on a matrix visual and the 2019 and 2020 column totals are correct  (the totals at the bottom of each column).      Cumulativ...
  • mahoneypat's avatar
    mahoneypat
    6 years ago

    What is the name of the column you used to give the Year values to the matrix (the field in the Columns field well).  I assumed you have a column that has year values in it.  Do you have an auto date hierarchy (i.e., you get .[Day], .[Month], etc. after your Date columns?).  If not already, please put the same column that is currently on your matrix visual to get Year values inside the VALUES( ) in that measure.

     

    Regards,

    Pat

     

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous this is what I will do, based on my measures, you can apply the same to your measure or the one you are using

     

    DYTD = 
    IF ( ISINSCOPE ( 'Calendar'[Year] ), TOTALYTD ( [Sales], 'Calendar'[Date] ), [Sales] ) *
    DIVIDE ( [Sales], [Sales] )
    
    DYTD = 
    SUMX ( VALUES ( 'Calendar'[Year] ),  TOTALYTD ( [Sales], 'Calendar'[Date] ) ) *
    DIVIDE ( [Sales], [Sales] )

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.