Forum Discussion

Ncf5031's avatar
Ncf5031
Icon for Advocate I rankAdvocate I
3 years ago
Solved

Subtract Column Value From Total Row Count - KM Survival Analysis

Needing help with two seemingly simple issues.    First, the goal of this analysis is to peform a KM Survival Analysis. I have searched here and the articles pertaining to that analysis don't quite...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Ncf5031 ,

    Please try below steps:

    1. add two measure with below dax formula

    RK =
    RANKX ( ALL ( 'Table' ), CALCULATE ( MAX ( 'Table'[EQUIP_HRS] ) ),, ASC )
    
    ALIVE_AT_Time =
    VAR ctn =
        COUNTROWS ( ALL ( 'Table' ) )
    VAR cur_tk = [RK]
    VAR tmp =
        FILTER ( ALL ( 'Table' ), [RK] <= cur_tk )
    VAR num =
        SUMX ( tmp, [FAILURE_AT_TIME] )
    RETURN
        ctn - num
    

    2. add a table visual with fields and measure

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_ Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.