Forum Discussion

drnareshchauhan's avatar
6 years ago
Solved

cumulative total

 

I am trying to do covid cases analysis, but stuck with the problem of cumulative total .

when I apllied cumulative formula as discribe here , cumulative mesure

 

Running Total MEASURE =
CALCULATE (
SUM ( 'PSM_COVID19_23_05 - Sheet1'[Total Confirmed] ),
FILTER (
ALL ( 'PSM_COVID19_23_05 - Sheet1' ),
'PSM_COVID19_23_05 - Sheet1'[Date of sample tested] <= MAX ( 'PSM_COVID19_23_05 - Sheet1'[Date of sample tested] )
)
)
 
 
it does do cumulative but when I add 'district'' as a legend it show same cumulative values for each district category
  • hello !

    this is how it worked

     

    Districtwise Cumulative Death = CALCULATE(SUM('confirmed death'[new confirmed death]),FILTER(ALL('confirmed death'),'confirmed death'[DATE OF OUTCOME]<=MAX('confirmed death'[DATE OF OUTCOME]) && 'confirmed death'[DISTRICT]=MAX('confirmed death'[DISTRICT])))
     
    thanks all

5 Replies

  • hello !

    this is how it worked

     

    Districtwise Cumulative Death = CALCULATE(SUM('confirmed death'[new confirmed death]),FILTER(ALL('confirmed death'),'confirmed death'[DATE OF OUTCOME]<=MAX('confirmed death'[DATE OF OUTCOME]) && 'confirmed death'[DISTRICT]=MAX('confirmed death'[DISTRICT])))
     
    thanks all
  • az38's avatar
    az38
    Community Champion

    Hi drnareshchauhan 

    try

     

    Running Total MEASURE =
    CALCULATE (
    SUM ( 'PSM_COVID19_23_05 - Sheet1'[Total Confirmed] ),
    FILTER (
    ALL ( 'PSM_COVID19_23_05 - Sheet1' ),
    'PSM_COVID19_23_05 - Sheet1'[Date of sample tested] <= MAX ( 'PSM_COVID19_23_05 - Sheet1'[Date of sample tested] ) && 'PSM_COVID19_23_05 - Sheet1'[District] = SELECTEDVALUE('PSM_COVID19_23_05 - Sheet1'[District])
    )
    )