Forum Discussion

niberxz's avatar
niberxz
Regular Visitor
9 years ago

Cumulative issue

Hello everyone, I am trying create an acomulative sum by date but recently I found a issue using this:

  • CALCULATE(DISTINCTCOUNT(Gestion[GesTot]),FILTER(all(Gestion),Gestion[FecGestion]<=max(Gestion[FecGestion])))

I was using the same statement with countax like this:

  • intensidad = CALCULATE((COUNTAX(Gestion,Gestion[VecesLlamada]>0)),FILTER(ALL(Gestion),Gestion[FecGestion]<=max(Gestion[FecGestion])))

This is the graph of "DISTINCTCOUNT(Gestion[GesTot])"

and this is "CALCULATE(DISTINCTCOUNT(Gestion[GesTot]),FILTER(ALL(Gestion),Gestion[FecGestion]<=max(Gestion[FecGestion])))"

The previous graph should have the accumulated sum by date and not be linear.

 

2 Replies

  • MalS's avatar
    MalS
    Resolver III

    Is "Gestion[FecGestion]" your Date field in your calendar table, because that's what you need for a cumulative sum. Here's a great explanation of the pattern: http://www.daxpatterns.com/cumulative-total/  

     

    Also, you say you want to do a sum, but you are using DISTINCTCOUNT - is that intentional?