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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

calculating active users over the months

I have a dataset like below:

Activities
UserDate
A1/1/2021
B1/3/2021
C1/5/2021
D1/8/2021
E2/3/2021

 

Contacts
UserDate
A1/1/2021
B1/4/2021
C1/5/2021
E1/18/2021
F2/1/2021
A2/9/2021

 

Calendar
Dates
1/1/2021
1/2/2021
1/3/2021
1/4/2021
1/5/2021
1/6/2021
1/7/2021
1/8/2021

 

Users
UserCategory
AABC
BABC
CSDF
DERT
EERT
FQWE

 

Data relations:

  • Users 1 to many Activities
  • Users 1 to many Contats
  • Calendar 1 to many Activities
  • Calendar 1 to many Contats

Active user: is a user who performed at least one activity (Activities or Contacts) during the month. And with that he should receive the 1 that month

Inactive User: is a user who has not performed any activity. And with that he should receive the 0 that month

This is the example of the results table I want:

Active User x MonthsJanFer
A11
B10
C10
D10
E01
F01


#Activities_Users = CALCULATE(DISTINCTCOUNT('Activities'[User]),USERELATIONSHIP('Activities'[Date],'Calendar'[Date]))

 

I already tried to create a measure to count the active users of one of the tables, however I don't know how to do to evaluate the 2 tables

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

// The Calendar table should be
// connected to both Contacts and
// Activities. No INACTIVE relationships
// should be present. Make sure that
// users are always selected from the
// Users dimension and time from Calendar.
// The fact tables should be hidden like
// Best Practices dictate. If you don't
// follow these, the formulas will not
// be working correctly.

[# Selected Users] = COUNTROWS( Users[User] )

[# Active Users] =
// An active user is one who
// in the selected period of
// time from Calendar has at
// least 1 entry in Activities or
// in Contacts.
COUNTROWS(
    DISTINCT(
        UNION(
            DISTINCT( Activities[User] ),
            DISTINCT( Contacts[User] )
        )
    )
)

[# Inactive Users] =
// In inactive user is one
// who has not been an active
// user in the selected period
// of time. In other words, subtract
// the active users from all the
// visible users in the current context.
[# Selected Users] - [# Active Users]

View solution in original post

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

// The Calendar table should be
// connected to both Contacts and
// Activities. No INACTIVE relationships
// should be present. Make sure that
// users are always selected from the
// Users dimension and time from Calendar.
// The fact tables should be hidden like
// Best Practices dictate. If you don't
// follow these, the formulas will not
// be working correctly.

[# Selected Users] = COUNTROWS( Users[User] )

[# Active Users] =
// An active user is one who
// in the selected period of
// time from Calendar has at
// least 1 entry in Activities or
// in Contacts.
COUNTROWS(
    DISTINCT(
        UNION(
            DISTINCT( Activities[User] ),
            DISTINCT( Contacts[User] )
        )
    )
)

[# Inactive Users] =
// In inactive user is one
// who has not been an active
// user in the selected period
// of time. In other words, subtract
// the active users from all the
// visible users in the current context.
[# Selected Users] - [# Active Users]

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.