Forum Discussion

rivastoday's avatar
rivastoday
Frequent Visitor
8 years ago
Solved

Support with Calculation evaluating several lines

Hello team I need support with the next:   I need to calculate the distint count of claims, the logic is sum AC1 + AC5 + AC14 with compensation, the formula is the next:   Reparability = CALCULAT...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    8 years ago

    Hi rivastoday,

    >>For my formula I need to calculate the distint count of the Claim Number,

     

    You can use the formula below to calculate the distint count of the Claim Number

    count=DISTINCTCOUNT(LAM_Data[Claim Number])

     

    >>I need to know how many real claims I have, and then how many compensated with AC1, AC5 and AC14. Additional to my formula I need to add how many AC36 I have, except if the claim with AC36 is in combination with AC1 in the same claim and the AC1 is compensated to avoid duplicity.


    Please calculate using the formula below.

    Reparability =
    CALCULATE (
        DISTINCTCOUNT ( LAM_Data[Claim Number] ),
        FILTER ( LAM_Data, LAM_Data[Compensation ] > 0 || LAM_Data[Action Code] = 1 )
    )
        + CALCULATE (
            DISTINCTCOUNT ( LAM_Data[Claim Number] ),
            FILTER ( LAM_Data, LAM_Data[Compensation ] > 0 || LAM_Data[Action Code] = 5 )
        )
        + CALCULATE (
            DISTINCTCOUNT ( LAM_Data[Claim Number] ),
            FILTER ( LAM_Data, LAM_Data[Compensation ] > 0 || LAM_Data[Action Code] = 14 )
        )
        + CALCULATE (
            DISTINCTCOUNT ( LAM_Data[Claim Number] ),
            FILTER (
                LAM_Data,
                LAM_Data[Action Code] = 36
                    || LAM_Data[Compensation ] = BLANK
            )
        )
    


    Best Regards,
    Angelia