Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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]
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |