Member Months Question

  • Member Months Question

    Posted by DSC Communities on April 20, 2020 at 4:01 pm
    • Michael Thoman

      Member

      April 20, 2020 at 4:01 PM

      Good Day,Ā 

      I need a way to show the total Member Months (Sum of active members by month) by group.Ā 
      I have a member list table that contains the effective date and termination date of all members and includes their group ID.Ā 
      On my report, I two date slicers, one for year and the other for month name.

      My thought process (and I may be terribly off) is to use a 3 variables (

      1. MinDate should equal the earliest date in my ‘Dates’ table (adjusted by the filter)
      2. MaxDate should equal the latest date in my ‘Dates’ table (adjusted by the filter)
      3 MemberMonthsList hold the member list information and calculate the datediff between the latest of Coverage_Start_date and MinDate and the earliest of the Coverage_End_Date and MaxDate.Ā 

      As an example, we want to calculate the total member months from March 2020 through April 2020
      Member IDĀ  Ā  Ā  Ā Effective DateĀ  Ā  Ā Termination DateĀ  Member Months
      000015115Ā  Ā  Ā  Ā 2020-01-01Ā  Ā  Ā  Ā  Ā 9999-12-31Ā  Ā  Ā  Ā  Ā  Ā 2 (Active for both March and April)
      000013658Ā  Ā  Ā  Ā 2020-01-01Ā  Ā  Ā  Ā  Ā 2020-03-31Ā  Ā  Ā  Ā  Ā  Ā 1 (Active for only March)
      000015858Ā  Ā  Ā  Ā 2020-04-01Ā  Ā  Ā  Ā  Ā 9999-12-31Ā  Ā  Ā  Ā  Ā  Ā 1 (Active for only April)

      Member Months for this group would equal 4.

      Here is a snap shot of my current measure. This appears to work for some groups by not all. Including some that return a negative number which leads me to believe that either the Filter on the MemberList table is wrong or the datediff is wrongĀ 

      Member Months =

      VAR MinDate = MIN(‘Dates'[Date])

      VAR MaxDate = MAX(‘Dates'[Date])

      VAR MemberMonthsList =

      ADDCOLUMNS(FILTER(‘Memberlist’,MemberList[Coverage_Start_Date] <= MaxDate && ‘MemberList'[Coverage_End_Date] >= MinDate),

      Ā Ā Ā Ā Ā Ā Ā  “DATEDIFF”,

      Ā Ā Ā Ā Ā Ā Ā  DATEDIFF(

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  IF(MemberList[Coverage_Start_Date] <= MinDate, MinDate, MemberList[Coverage_Start_Date]),

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  IF(MemberList[Coverage_End_Date] >= MaxDate, MaxDate, MemberList[Coverage_Start_Date]),MONTH)+1)

      RETURN

      SUMX(MemberMonthsList, [DATEDIFF])

      Any help would be greatly appreciated.Ā 

      Cheers

      ——————————
      Michael Thoman

      ——————————

    DSC Communities replied 5 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Member Months Question’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!