Forum Discussion

clmigeon's avatar
clmigeon
Frequent Visitor
5 years ago
Solved

multi sum with cumulative value

Hi ,

Thank for your help you provid me on a other matter. 


I realise that my problem is more complicat . 
in fact i have : 

NoaccountNojournCreditdevitdatesc
511204050000001/01/2020TOTO
5112016500001/01/2020TOTO
51120160-20001/02/2020TOTO
5112016400001/02/2020TOTO
4520016500001/04/2020TOTO
45200160-20001/02/2020TOTO
4520016400001/01/2020TOTO
45200160-50001/02/2020TOTO
4520016400001/01/2020TATA
45200160-50001/02/2020TATA
511204050000001/01/2020TATA
5112016500001/01/2020TATA


And I want that a repport like 

 

SC Noaccount01/01/202001/02/202001/03/2020
TATA5112050500  
45200400-100 
TOTO511205050050900 
45200400-300200

 

  • Hi clmigeon ,

     

    To what I can see you want the calculation to be cumulative in this case try the following measure:

     

    Measure = CALCULATE(SUM('Table'[Credit]) + SUM('Table'[devit]), FILTER(ALL('Table'[date]) , 'Table'[date] <= MAX('Table'[date])))

     

    then use a matrix visualization:

     

4 Replies

  • Hi clmigeon ,

     

    To what I can see you want the calculation to be cumulative in this case try the following measure:

     

    Measure = CALCULATE(SUM('Table'[Credit]) + SUM('Table'[devit]), FILTER(ALL('Table'[date]) , 'Table'[date] <= MAX('Table'[date])))

     

    then use a matrix visualization:

     

  • clmigeon's avatar
    clmigeon
    Frequent Visitor

    hi MFelix , 
    Thank for the help, i don't understand why it doesn't work on me : 

    Measure = CALCULATE(SUM('Feuil1'[Credit]) + SUM('Feuil1'[devit]), FILTER(ALL('Feuil1'[1/1/2020]) , 'Feuil1'[1/1/2020] <= MAX('Feuil1'[1/1/2020])))
     

     

    • MFelix's avatar
      MFelix
      Super User

      Hi clmigeon ,

       

      This is not a calculated column you need to create a measure. Right click on the table but instead of adding a new column add a new measure.

       

      Also taking into attention you have a column with transaction that basically is the credit/debit you can redo your measure to:

      Measure = CALCULATE(SUM('Feuil1'[Transaction]), FILTER(ALL('Feuil1'[1/1/2020]) , 'Feuil1'[1/1/2020] <= MAX('Feuil1'[1/1/2020])))

       

  • clmigeon's avatar
    clmigeon
    Frequent Visitor

    Thx MFelix  ! it work 🙂

    could a ask a last advice ? 
    I have for each information an other value Nojourn , i need to take the Value 1 time for one id (40) , i need to take the older value. 
    For Exemple : 

     

    In 03/10/2020 i need to skip the value in the sum , how could i ?