Forum Discussion

vivek_babu's avatar
vivek_babu
Helper II
1 year ago
Solved

DAX Calculated Column Issue

Hi All,   I am trying to calculate the previous average coverage percentage based on the reporting date and system name columns. The formula i used below works if i dont consider system name to get...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi vivek_babu 

    Please try the follow dax:

    Previous_Percentage_Coverage = 
    var currentdate = DEEP_SECURITY[REPORTING_DATE]
    var previousdate = MAXX(FILTER(ALL(DEEP_SECURITY),DEEP_SECURITY[REPORTING_DATE] < currentdate),DEEP_SECURITY[REPORTING_DATE])
    var currentsysname = max(DEEP_SECURITY[SYSTEM_NAME])
    RETURN
    MAXX(FILTER(ALL(DEEP_SECURITY),DEEP_SECURITY[REPORTING_DATE] = previousdate && DEEP_SECURITY[SYSTEM_NAME] = EARLIER(DEEP_SECURITY[SYSTEM_NAME])
    ),
    DEEP_SECURITY[avg_percentage_covered])

     

     

    Result:

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.