Forum Discussion

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Please try this expression, substituting your actual table and column names

     

    NewMeasure = SUMX(VALUES('Date'[Year]), [Retention])

     

    This should give you the correct result in both your rows and total.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      I use this function

      Retention Count = SUMX(VALUES('Purchases'[Customer]),[Retention])
      and it worked but seems like it doesn't count all rentention.
      As you can see year 2015 and 2016 there is retention but on retention count it doesn't.
      Is there a way to fix?
      Untitled.jpg
  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi Anonymous ,

     

    You could try the following measure:

    Retention =
    VAR a =
        IF (
            [Retention condition 1] >= 1
                || [Retention Condition 2] >= 1
                || [Retention Condition 3] >= 1,
            1,
            0
        )
    VAR b =
        COUNTX ( VALUES ( dCalendar[YEAR] ), a )
    RETURN
        IF ( ISINSCOPE ( dCalendar[YEAR] ), a, b )