Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Stuquan
Frequent Visitor

Track 'new' users per month based on conditions

Hi,

 

I am trying to create a line graph that will show absolute new users per month based on their assigned user mapping.

 

My criteria are if the users are either a 'Developer', 'Report Viewer' or 'Report Creator'. I already have the following code working for each mapped type to give me the total number of users based on a calculated mapping column in my 'logs' table, this code then works through each activity in the mapping and counts the values up, if the user hits the 'dataset developer' value then they are a developer, if they only hit the report viewer and creator, then they are a creator and so on:

 

Dataset Developer Count = 
        VAR _Activities =
            ADDCOLUMNS (
                VALUES ( Logs[UserKey] ),
                "Report Viewer Activities", CALCULATE ( COUNTROWS ( Logs ), Logs[Mapping] = "Report Viewer" ),
                "Report Creator Activities", CALCULATE ( COUNTROWS ( Logs ), Logs[Mapping] = "Report Creator" ),
                "Dataset Developer Activities", CALCULATE ( COUNTROWS ( Logs ), Logs[Mapping] = "Dataset Developer" )
            )
        VAR _Logic =
            ADDCOLUMNS (
                _Activities,
                "User Type",
                    SWITCH (
                        TRUE (),
                        [Dataset Developer Activities] > 0 && [Report Creator Activities] > 0, "Dataset & Report Developer",
                        [Dataset Developer Activities] > 0, "Dataset Developer",
                        [Report Creator Activities] > 0, "Report Creator",
                        [Report Viewer Activities] > 0, "Report Viewer"
                    )
            )
        VAR _Count =
            COUNTROWS ( FILTER ( _Logic, [User Type] = "Dataset Developer" ) )
        RETURN
            _Count

 

I'm struggling with the time intelligence aspect of this. How can I keep this same logic, but show it for a month on month basis for only new users so that they are not counted again in the following month?

3 REPLIES 3
lbendlin
Super User
Super User

Why would the "new user" property be impacted by the activity type?

Hey @lbendlin, thanks for taking the time to reach out.

 

I need to see each of the three categories new users for each month. The logic above filters out the three different categories based on activity e.g.  if the same person views and develops, they will be categorised as a developer only that's why I need to separate the different user types because the same person could appear as a viewer and developer and in this scenario I would only want their 'highest rank' e.g. developer if they have been developing. 

 

Hope that makes sense.

Remember that SWITCH() stops at the first match - use that to your advantage.

 

Think about scenarios when they change roles between months. How do you plan to handle that?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.