Forum Discussion

ribisht17's avatar
ribisht17
Icon for Super User rankSuper User
2 years ago
Solved

Running Total not working as expected

Hello Datafam,

 

amitchandak 

 

I have the below scenario where I need to calculate RUNNING total,

 

It not giving me the exact output as I was looking for

 

 

See the Yellow part showing the wrong running total

 

 

I am using this DAX function,

 

Count Certification Active running total in Cert Calendar Date =
CALCULATE(
    sum('Master Certification Tab'[Certification Count_C]),
    FILTER(
        ALLSELECTED('Certification Calendar Date'[Cert Calendar Date]),
        ISONORAFTER('Certification Calendar Date'[Cert Calendar Date], MIN('Certification Calendar Date'[Cert Calendar Date]), desc)
    )
)
 
No sure about the issue with this DAX, I am using calendar dates here
 
Let me know if you need more info
 
Regards,
Ritesh

 

  • ribisht17 , Make sure that Year, Qtr, and month are from the 'Certification Calendar Date' and it not a from a Auto date hierarchy , There should be columns from 'Certification Calendar Date' 

     

     

    few version

     

    CALCULATE(
    sum('Master Certification Tab'[Certification Count_C]),
    FILTER(
    ALLSELECTED('Certification Calendar Date'[Cert Calendar Date]),
    'Certification Calendar Date'[Cert Calendar Date]<= Max('Certification Calendar Date'[Cert Calendar Date])
    )
    )

     


    CALCULATE(
    sum('Master Certification Tab'[Certification Count_C]),
    FILTER(
    all('Certification Calendar Date'[Cert Calendar Date]),
    'Certification Calendar Date'[Cert Calendar Date]<= Max('Certification Calendar Date'[Cert Calendar Date])
    )
    )

2 Replies

  • ribisht17 , Make sure that Year, Qtr, and month are from the 'Certification Calendar Date' and it not a from a Auto date hierarchy , There should be columns from 'Certification Calendar Date' 

     

     

    few version

     

    CALCULATE(
    sum('Master Certification Tab'[Certification Count_C]),
    FILTER(
    ALLSELECTED('Certification Calendar Date'[Cert Calendar Date]),
    'Certification Calendar Date'[Cert Calendar Date]<= Max('Certification Calendar Date'[Cert Calendar Date])
    )
    )

     


    CALCULATE(
    sum('Master Certification Tab'[Certification Count_C]),
    FILTER(
    all('Certification Calendar Date'[Cert Calendar Date]),
    'Certification Calendar Date'[Cert Calendar Date]<= Max('Certification Calendar Date'[Cert Calendar Date])
    )
    )

  • Thanks much Amit, looks like it will work , I will mark your answer when I test it

     

    Regards,

    Ritesh