Forum Discussion

ssspk's avatar
ssspk
Helper III
2 years ago
Solved

How to get the First Time Users List based on the data?

Hi,

I have a list of users who clicked the applications on specific time.I would like identifiy the first time users list from the available data,

data[user] and data[servertime] both has the value of the user and data(servertime)

Thanks in Advance.

2 Replies

  • ssspk , First-time user for a selected duration, assuming you are using data table

     

    Previous =

    var _min = minx(allselected('Date'), 'Date'[Date])

    return

    calculate(count(Table[User]), filter(all('Date') , 'Date'[Date] <= _min))

     

    Current = count(Table[User])

     

    First time user=  Countx(values(Table[User]), if( isblank([Previous]) && not(isblank([Current])) , [User], blank() ) )

     

    Also, check

     

    Customer Retention Part 5: LTD Vs Period Retention
    https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-5-LTD-and-PeriodYoY-Retention-is-only/ba-p/2114497

    • ssspk's avatar
      ssspk
      Helper III

      Hi Amit,

      Thank you for your reply and time.

      2 different first time measures gives different results,

      I have added the Measure propely as like below,

      _Previous =
      VAR _min = MINX(ALLSELECTED('data'), 'data'[servertime])
      VAR _filteredData = FILTER(
          'data',
          'data'[type] = 4 || 'data'[type] = 6 && 'data'[appid] > 0  -- Added filtering condition here
      )
      RETURN
          CALCULATE(
              COUNTROWS('data'),
              FILTER(_filteredData, 'data'[servertime] <= _min)
          )
        
      _Current = CALCULATE(COUNT(data[user]), data[type] = 4 || data[type] = 6 , data[appid] > 0)
       
      _First time user = Countx(values(data[user]), if( isblank([_Previous]) && not(isblank([_Current])) , [user], blank() ) )
      The above measure gives result as like below,
       
       
       
       
       
       
       
      By executing the below Measure gives different result for the first time users,
      FirstTimeUsersColumn =
      VAR
        _minDate =
          CALCULATE (
            MIN ( 'data'[servertime] ),
            FILTER (
              ALLSELECTED('data'),  -- Consider ALLSELECTED for better performance with slicers
              'data'[user] = EARLIER ( 'data'[user] ) &&
              ('data'[type] = 4 || 'data'[type] = 6) &&
              'data'[appid] > 0
            )
          )
      RETURN
        IF ( 'data'[servertime] = _minDate, 1, 0 )
      As a result it shows like below,
       
       
       
       
       
       
      Here which one is correct and to use in the application?
       
      Thanks and Regards,
      Siva