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

How to calculate Sum of Daily Active Users?

$
0
0

Hey guys,

 

quick DAX question. I have two tables, one table with users (two columns: users[id], users[name]) and another table with actions (actions[date], actions[user_id]). Besides that I have a calendar table.

 

Now I want to calculate the number of "active users", meaning the number of users who are active per time frame. That's pretty easy via:

 

Active Users = 
CALCULATE(
	COUNTROWS(users),
	FILTER(users,
		CALCULATE(
			COUNTROWS(actions), 
			FILTER(ALL(actions), 
				actions[user_id] = users[id] &&
				actions[date] >= MIN(calendar[Date]) &&
				actions[date] <= MAX(calendar[Date])
			)
		) > 0
	)
)

But if I want to calculate the number of "Daily Active Users" per time frame, meaning the Sum over the number of days one user is active per time frame over all users, I don't have any clue how to do that in a measure without creating an extra Crossjoin table between the users table and the calendar.

 

Any clues?

 

Thank you,

Sebastian


Viewing all articles
Browse latest Browse all 217157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>