Forum Discussion

BenFransen's avatar
BenFransen
Advocate II
9 years ago
Solved

Dynamic line chart for CUSUM analysis

I'm wondering how I can make a dynamic line chart. The goal I'm trying to achieve is to create a CUSUM chart. In hospital care this is used to plot a trend line on how you're doing regarding mortalit...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi BenFransen,

     

    According to your description, you want to calculate dynamic value which based on "RiskScore" and "PatientDied" columns, right?

     

    If that is a case, you can refer to belwo sample:

     

    Measures:

     

    CurrentValue =
    var currPatientDied= LASTNONBLANK(Sheet2[PatientDied],[PatientDied])
    Return
    Max([RiskScore])*SWITCH(currPatientDied,FALSE(),1,TRUE(),-1)

     

    CUSUMValue =
    SUMX(FILTER(ALL(Sheet2),Sheet2[EventID]<=MAX([EventID])),[CurrentValue])

     

    Create line chart:

     

    Regards,

    Xiaoxin Sheng