Forum Discussion

Kay_Kalu's avatar
Kay_Kalu
Helper I
1 year ago
Solved

Error on Multiple date selection

I have this table with a rate calculation want to be able to select mutiple date and not get an error Table image The dax use to generate the rate is  TerminationsCount = COUNTROWS(P_MDT002_...
  • HarishKM's avatar
    1 year ago

    Kay_Kalu Hey,
    Can you please below measure?

    TerminationRate =
    VAR SelectedDate = MAX('LIGHTHOUSE_CALENDAR'[SelectionDate])

    VAR TerminationsCount = COUNTROWS(P_MDT002_TERMINATIONS_LAPSES)

    VAR ActivePolCount =
    COUNTROWS(
    FILTER(
    P_MDT000_MASTER,
    P_MDT000_MASTER[EFFECTIVE_DATE] <= SelectedDate &&
    RELATED('REF070_PRODUCT_TAXONOMY'[MIGRATION_DATE]) <= SelectedDate &&
    (
    P_MDT000_MASTER[STATUS] < 6000 ||
    (
    P_MDT000_MASTER[STATUS] >= 6000 &&
    P_MDT000_MASTER[STAT_DATE] > SelectedDate
    )
    )
    )
    )

    RETURN
    DIVIDE(TerminationsCount, ActivePolCount, 0)

     

     

    Thanks
    Harish M
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query