How to calculate Daily Active Users (DAU)
Daily active users is the number of distinct users who perform a qualifying action in your product on a given day.
Formula
DAU = count of distinct users with at least one qualifying event that daySQL query
This example assumes: events(id, user_id bigint, event_name text, occurred_at timestamptz). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
SELECT occurred_at::date AS day,
COUNT(DISTINCT user_id) AS dau
FROM events
WHERE event_name NOT IN ('email_opened', 'push_received')
AND occurred_at >= CURRENT_DATE - 30
GROUP BY 1
ORDER BY 1;Common mistakes that make Daily Active Users (DAU) wrong
- Define what counts as active (logging in, a key action, or any event); background events inflate DAU.
- The day boundary uses a time zone; group by the zone your team reports in.
- Counting events instead of distinct users is the most common error.
Ask for Daily Active Users (DAU) in plain English
Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.
- How many daily active users did we have each day for the last 30 days?
- What was the highest DAU in the last quarter?