Forum Discussion

datanau001's avatar
datanau001
Helper III
5 years ago
Solved

DAX Calculated column if statement (KPI Indicator)

Dear all,   I’m trying to create an indicator column in Dax using IF condition which will test the following:   KPI Indicator = IF ('V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs] < 'V_SR_STATUS_L...
  • Fowmy's avatar
    5 years ago

    datanau001 

    Because  you added a calculated column, the result is evaluated on each row, to solve it, create a measure as follows and it instead of the column:

    KPI Indicator Measure=
    IF (
        SUM ( 'V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs] ) < SUM ( 'V_SR_STATUS_LINES_SEC'[SPE KPI] ),
        "KPI Met",
        "KPI Not Met"
    )
    
  • datanau001's avatar
    datanau001
    5 years ago

    Hello, here is a way we can make it works with a calculated column:

    KPI Indicator =
    CALCULATE (
        SUM ( 'V_SR_STATUS_LINES_SEC'[Total Audit Time Hrs] ),
        FILTER (
            ALLSELECTED ( 'V_SR_STATUS_LINES_SEC' ),
            'V_SR_STATUS_LINES_SEC'[SR] = MAX ( 'V_SR_STATUS_LINES_SEC'[SR] )
        )
    )