Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Active and Inactive Users

Hi everyone. 

 

I have some troubles trying to calculate active and inactive users. I have the next tables (it's an example)

 

Table 1 

 

PhoneDateClient
22201/08/19A
22201/02/20B
22401/02/20A

 

Table 2 

 

PhoneEmailID
222exam..1
224ex...3
223exam2...2

 

 

Table 1 is about the transaction and table 2 is about an user database. So I want to know the active users and inactive users by phone. For example in 2019 there was just 1 active user and 2 inactive users. 

 

I have a calendar table. Thank you very much. 

  • Hi Anonymous ,

     

    We can create a measrue and there is no relationship between date table and table to meet your requirement.

     

    Measure = 
    var selected_ = SELECTEDVALUE('Date'[Date])
    var date_long = DATEDIFF(MAX('Table'[Date]),TODAY(),MONTH)
    var date_long1 = DATEDIFF(selected_,TODAY(),MONTH)
    return
    IF(date_long>date_long1,"inactive","active")

     

     

     

     

    If it doesn't meet your requirement, could you please show the exact expected result based on the table that we have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi Anonymous ,

     

    Sorry for that we don’t understand your issue clearly.

    What is your desire result? And how to judge if a user is active or inactive?

    Could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply?

    It will be helpful if you can show us the exact expected result based on the tables.

    Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.     

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes of course. 

       

      I have a data base about users, each phone each a user. Each row is a transaction, so I want to know for example who is inactive five months ago.

      For example, my last transaction was five months ago, so If I filter it with the calendar 3 months ago I'm an inactive user, on the other hand If I filter it with the calendar 6 months ago I'm an active user. 


      What I did was this: 
      Operations = countrows(table1)
      Status= IF(operations=0,"Inactive","Active")
      But It does not work at all. Because It works when I put it on a table but not in a graphic. 
      Thank you. 

      • v-zhenbw-msft's avatar
        v-zhenbw-msft
        Community Support

        Hi Anonymous ,

         

        We can create a measrue and there is no relationship between date table and table to meet your requirement.

         

        Measure = 
        var selected_ = SELECTEDVALUE('Date'[Date])
        var date_long = DATEDIFF(MAX('Table'[Date]),TODAY(),MONTH)
        var date_long1 = DATEDIFF(selected_,TODAY(),MONTH)
        return
        IF(date_long>date_long1,"inactive","active")

         

         

         

         

        If it doesn't meet your requirement, could you please show the exact expected result based on the table that we have shared?

        BTW, pbix as attached.

         

        Best regards,

         

        Community Support Team _ zhenbw

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.