Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

active users over a period

Hi,

I have a requirement where i need to find the count of active user per month/Qtr/Year based on slicer selection from the sample data attached here.The active or inactive status is described by Flag column.

If we have a slicer from date dimension,it should check if user is belonging in that range between start and end date.If the user belongs to the window and flag=true ,then the user is to be counted in the headcount.

Pls guide as i am not sure how to do this without a relationship between fact and date tables.

Note: Data in the date table contains all dates from 1/1/2020 to 12/31/2023

 

11 Replies

  • You are wasting space by presenting a calendar/dates table that goes far beyond the current date.  No user can have been active in the future (unless you know special tricks?) so the first thing you want to do is to cut the dates table down to cover just the actual data range.

     

    Next you can create relationships between the calendar table and the Start and End dates in your fact table. Both relationships can be inactive.

     

    And finally you can use CROSSFILTER(,,none) to create a cartesian product between your fact table Login ID and/or Application which then allows you to determine if a particular user was using a particular app on a particular day.

     

    Lastly you can use the Active flag as a filter for the summary count.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Thanks for looking into this.To answer your question in comment:

      • "You are wasting space by presenting a calendar/dates table that goes far beyond the current date.  No user can have been active in the future"

      I would like to clarify here that the requirement i received is such where they are doing a long term forecast and that is the nature of the data.It is assumed that they are going to be active and further there is a requirement of allocating budget for each of application into this model.I am also attaching that budget fact table in the model which will clarify the end goal.End goal is to find out cost per application per month per loginID.Then roll up to different levels.

      Model https://drive.google.com/file/d/16rCk0jSJwZ25fDCZbsVzp0yYxk0kU4LZ/view?usp=sharing 

      • Can you please show and tell on the model i am attaching here.
      • lbendlin's avatar
        lbendlin
        Super User

         

        Your yearly budget amount per app doesn't vibe with the data model, so the budget table will have to stay disconnected, and you will have to use LOOKUPVALUE for any annual measures.

         

        "End goal is to find out cost per application per month per loginID"

         

        Which visual are you planning to use fo that, and when does the budget come into play?

        Your sample data is inconsistent, the budget mentions PowerBI (sic) and the usage mentions PowerApp (sic). I took the liberty to change both to Power BI.