Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I am trying to calculation the unique number of users who did 2 or more activities from two separate columns in one table.
My data looks like this:
Table
user_id | activity_id |
1 | aa |
2 | aa2 |
3 | aa3 |
4 | aa4 |
5 | aa5 |
First I want to get the distinct count of users and then filter those users that have done 2 or more activities.
I am trying something like this, but I am not getting the values right.
VAR allData =
ADDCOLUMNS(
VALUES(Table[activity_id]),
"rowCount",
CALCULATE( COUNTROWS( Table) )
)
return
CALCULATE(
COUNTROWS( allData ),
filter (allData, [rowCount] >=7)
)
I appreciate all the help.
Thanks a lot @amitchandak !
Can you explain to me this forumla, more walk me thought it?
I am trying to validate the values. and I am trying to change the filter from 2 to 1 to 3 ...etc but the number doesnt change.
so I am not sure its counting the right values.
What I am trying to get the count of users who has 2 or more activities.
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 |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |