Forum Discussion

InsureBI's avatar
InsureBI
Advocate II
9 years ago
Solved

Multiple Filters COUNTROWS - Too Few Arguments Passed

I have a "Policy" table with the following information:   Policy No., Issued_Date, Premium, Policy_Type 10001,1/1/2016,250,P 10002,1/1/2016,300,P 10003,1/2/2016,260,S 10004,1/2/2016,320,P 1000...
  • v-ljerr-msft's avatar
    9 years ago

    InsureBI

     

    In addition to ankitpatira's solution, you should be able to create a measure to calculate the cumulative number of policies (or records) by issued date and by policy type as you mentioned above. The formulas below are for your reference.

    Cuml_Pol_Count_P = 
    CALCULATE (
        IF ( ISBLANK ( COUNTROWS ( Policy ) ), 0, COUNTROWS ( Policy ) ),
        FILTER (
            ALLSELECTED ( Policy ),
            Policy[ISSUED_DATE] <= MAX ( Policy[ISSUED_DATE] )
                && Policy[POLICY_TYPE] = "P"
        )
    )

    Cuml_Pol_Count_S =
    CALCULATE (
    IF ( ISBLANK ( COUNTROWS ( Policy ) ), 0, COUNTROWS ( Policy ) ),
    FILTER (
    ALLSELECTED ( Policy ),
    Policy[ISSUED_DATE] <= MAX ( Policy[ISSUED_DATE] )
    && Policy[POLICY_TYPE] = "S"
    )
    )

    Following is the result of the measures in report.

    Regards