Finance Path · Mission 17 of 25Hard

Revenue concentration

Subquery for percentage-of-total calculation

Back to Finance

The Brief

Priya ShahCFOslack-dm

For the investor update — 2025 revenue by account with share of total. Columns: `account_name`, `revenue`, `pct_of_total`. Only revenue accounts, posted entries, sorted by revenue DESC.

You'll practice

PERCENT_RANKCumulative share

Tables available

fact_transactionsdim_accounts

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

JOIN fact_transactions and dim_accounts, filter LOWER(account_type) = 'revenue' and posted = 1 and 2025.

Hint 2

GROUP BY account_name, SUM(amount) AS revenue.

Hint 3

pct_of_total = revenue / (SELECT SUM(amount) FROM ... WHERE same filters) — a scalar subquery.