Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Average users per group

$
0
0

Good morning!  I am just starting to use PowerBI and DAX, and have been frustrated by what seems like it should be an easy thing.

 

Given a table like this:

 

Group_NameGroup_IDUser_ID
Group 11100
Group 11200
Group 11300
Group 22100

 

I want to calculate the average number of people per group. In this case "2" ((3 + 1)/2). I've tried setting up a second table based using SUMMARIZE, so it ends up like:

Group_IDUserCount
13
21

And then tried to calculate the AVERAGE of that new table.  But my SUMMARIZE never turns out right. 

 

SUMMARIZE(group_user_links,group_user_links[group_id], "UserCount", DISTINCTCOUNT(group_user_links[user_id])) or

SUMMARIZE(group_user_links,group_user_links[group_id], "UserCount", COUNTX(group_user_links, group_user_links[user_id])) end up way too high.

 

Is that the best way to go about it? Or is there a better way?

 

Patrick+


Viewing all articles
Browse latest Browse all 213819

Trending Articles