Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a dataset like below:
| Activities | |
| User | Date |
| A | 1/1/2021 |
| B | 1/3/2021 |
| C | 1/5/2021 |
| D | 1/8/2021 |
| E | 2/3/2021 |
| Contacts | |
| User | Date |
| A | 1/1/2021 |
| B | 1/4/2021 |
| C | 1/5/2021 |
| E | 1/18/2021 |
| F | 2/1/2021 |
| A | 2/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 | |
| User | Category |
| A | ABC |
| B | ABC |
| C | SDF |
| D | ERT |
| E | ERT |
| F | QWE |
Data relations:
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 Months | Jan | Fer |
| A | 1 | 1 |
| B | 1 | 0 |
| C | 1 | 0 |
| D | 1 | 0 |
| E | 0 | 1 |
| F | 0 | 1 |
#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
Solved! Go to Solution.
// 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]
// 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]
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 13 | |
| 12 | |
| 10 |