Forum Discussion

salafoo's avatar
salafoo
Helper I
5 years ago
Solved

Two filters variables calculation error

Hello All,   I hopu you are doing well?   I am writing to get a help with a code, I was trying to create a caluculated measure with multiple filters using variables, however, the formula kept gen...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi salafoo,

    I try to simplify your formula and merge these conditions, you can try to use the following expressions if it works on your side.

    Under process WS Grant =
    VAR UnderProcessFilter =
        CALCULATETABLE (
            'TWS Wage Subsidy',
            FILTER (
                ALLSELECTED ( 'TWS Wage Subsidy' ),
                [Segment Reference (groups)] = "MoL Segment - Diploma"
                    && [Workflow Status (groups)] = "Under Process"
                    && [Status] = "Active"
            ),
            FILTER (
                ALLSELECTED ( 'TWS Employee Application' ),
                NOT ( [Workflow Status] IN { "Sent Back to Portal", "Created - Not Submitted" } )
                    && [Monitoring Status] <> "Flagged"
            )
        )
    RETURN
        SUMX (
            UnderProcessFilter,
            MIN ( [Current Wage] * 12 * 0.7, 8400 )
                + MIN ( [Current Wage] * 6 * 0.5, 4200 )
        )

    Regards,
    Xiaoxin Sheng