Cash Flow Command Center
A five-page Power BI report for a professional services firm that tracks every day between doing the work and banking the cash: lockup, DSO, revenue leakage, collections priorities, client risk and a 90-day cash forecast.

The ask
Lamothe Engineering Group, a fictional utility engineering consultancy, wanted to know why cash was arriving later than billing terms suggested. Leadership needed one report that measured the whole time-to-cash cycle with standard AR metrics, showed where billable value leaked, and told the AR team who to call first.
The business questions
Each report page answers one question for a specific audience. Synced slicers for month-end, client tier, account manager and service line filter every page.
| Page | Business question | Audience | Key measures |
|---|---|---|---|
| Overview | How many days of revenue are locked up, and is it getting better? | CFO, controller | Lockup days, DSO, BPDSO, ADD, CEI, AR aging |
| Leakage | Where does billable value leak before it becomes cash? | Controller, project managers | Billing realization, unbilled time, fixed-fee variance |
| Collections | Which invoices should we chase today? | AR team, account managers | Past-due AR, chase priority score, collection curve |
| Client Risk | Which clients pay late, and who could become bad debt? | CFO, account managers | Days beyond terms, risk score, concentration (HHI) |
| Forecast | What cash lands in the next 90 days, and are we pricing work right? | CFO, delivery leads | Expected cash, utilization, margin, bill rates |
How I built it
- Step 1Modeled the dataCleaned seven CSVs in Power Query and built a star schema: invoice, payment, write-off and timesheet facts around client, project, employee and date dimensions, with row-level security by account manager.
- Step 2Wrote the measures in DAX92 measures, including countback DSO, best possible DSO, CEI, lockup days, a weighted client risk score, a chase priority score and a 90-day cash forecast with what-if payment delay and late fee parameters.
- Step 3Designed the reportA dark theme with a branded header, a synced slicer bar and one grid across all five pages, with teal for healthy and amber for risk. Built as a PBIP project with the model in TMDL, so every change is tracked in source control.
Built with an AI agent
I built this project with Claude Code working as an agent alongside me in Power BI Desktop. Instead of clicking through menus, the agent wrote the project’s source files directly, and I reviewed every page and steered the design.
- The model as code: Power BI’s PBIP format stores the semantic model as TMDL text and each visual as JSON. The agent generated both from Python build scripts, so the whole report can be rebuilt from scratch in seconds.
- Checked against Microsoft’s schemas: every page and visual file (97 in total) is validated against Microsoft’s published PBIR JSON schemas before Power BI opens it.
- Numbers reconciled to an answer key: lockup, DSO, best possible DSO and ADD were checked against independently calculated values before any design work began.
- Design by iteration: the agent produced three header and color mockups as interactive artifacts, then refined the chosen one over several rounds of screenshot feedback, fixing alignment, clipped labels and chart readability.
The data model
A star schema keeps every measure simple and fast. Four fact tables share four dimensions, and small helper tables drive the slicers, aging buckets, forecast windows and what-if parameters.
| Layer | Tables | Notes |
|---|---|---|
| Facts | Invoice, Payment, WriteOff, Timesheet | 1,112 invoices, 1,101 payments and 84K timesheet entries for 40 clients, January 2024 to November 2026 |
| Dimensions | Client, Project, Employee, Date | Date has inactive links for due date, service month and last payment, used with USERELATIONSHIP |
| Helpers | As Of, Aging Bucket, Forecast Window, Waterfall Step | As Of lets a viewer rewind every page to any month-end |
| What-if | Payment Delay Shift, Late Fee % | Drive the forecast scenarios on the Forecast page |
| Security | Account Manager role | Row-level security: each manager sees only their own clients |

What the report shows
- Lockup is 90.1 days, and 24.4 of them come from clients paying late rather than from billing terms.
- DSO is rising: 90-day DSO climbed from about 41 days in early 2026 to about 61 by year end, while best possible DSO stayed in the 30s.
- Most receivables are still recent: 93% of the $1.26M open AR is current or 1 to 30 days late, so this is a follow-up problem, not a bad-debt problem.
- Fixed-fee work leaks the most, with 90.1% billing realization against 96.8% on time and materials, and $254K of overruns in 12 months.
- Two clients stand out: Pinecrest Natural Gas and Alder Natural Gas are both rated high risk and sit in the top five for past-due AR.
Recommendations
- Escalate the two high-risk accountsPinecrest and Alder hold $170K of past-due AR between them.
- Work the collections list dailyContact clients before invoices pass 30 days; $419K sits 1 to 30 days late today.
- Tighten fixed-fee scopingChange orders and better estimates would recover most of the $254K overrun.
- Test a late fee for repeat late payersThe forecast page models the cash impact before any policy changes.
Inside the report




Key DAX measures
The core of the time-to-cash math: countback DSO, best possible DSO, the delinquency gap, lockup, and the score that ranks the collections worklist.
Show the DAX
-- Countback DSO: consume open AR with the newest months' billings first.
DSO (Countback) =
VAR _asof = [As Of Date]
VAR _ar = [Open AR]
VAR _months =
ADDCOLUMNS (
CALCULATETABLE ( VALUES ( 'Date'[MonthStart] ), REMOVEFILTERS ( 'Date' ), 'Date'[Date] <= _asof ),
"@Billed",
VAR _m = 'Date'[MonthStart]
RETURN CALCULATE ( [Net Billings], REMOVEFILTERS ( 'Date' ), 'Date'[MonthStart] = _m, 'Date'[Date] <= _asof ),
"@Days",
VAR _m = 'Date'[MonthStart]
RETURN INT ( MIN ( EOMONTH ( _m, 0 ), _asof ) - _m ) + 1
)
VAR _ranked =
ADDCOLUMNS (
_months,
"@Newer",
VAR _m = 'Date'[MonthStart]
RETURN SUMX ( FILTER ( _months, 'Date'[MonthStart] > _m ), [@Billed] )
)
VAR _full = FILTER ( _ranked, [@Newer] + [@Billed] <= _ar )
VAR _used = SUMX ( _full, [@Billed] )
VAR _partial = TOPN ( 1, FILTER ( _ranked, [@Newer] + [@Billed] > _ar ), 'Date'[MonthStart], DESC )
RETURN
SUMX ( _full, [@Days] ) + SUMX ( _partial, DIVIDE ( _ar - _used, [@Billed] ) * [@Days] )
-- DSO if every client paid on terms.
Best Possible DSO =
DIVIDE ( [Current AR], [Billings Last 90 Days] ) * 90
-- Days of revenue lost purely to late payment.
Average Days Delinquent =
[DSO (90-day)] - [Best Possible DSO]
-- Total days from doing the work to banking the cash.
Lockup Days =
[WIP Days] + [DSO (Countback)]
-- Balance x (1 + days past due / 30) x (1 + client risk / 100).
Chase Priority =
VAR _asof = [As Of Date]
RETURN
SUMX (
CALCULATETABLE ( VALUES ( Invoice[InvoiceID] ), REMOVEFILTERS ( 'Date' ), Invoice[InvoiceDate] <= _asof ),
VAR _bal = [Open AR]
VAR _dpd = MAX ( 0, INT ( _asof - CALCULATE ( MAX ( Invoice[DueDate] ) ) ) )
VAR _client = CALCULATE ( MAX ( Invoice[ClientID] ) )
VAR _risk = CALCULATE ( [Client Risk Score], REMOVEFILTERS ( Invoice ), Client[ClientID] = _client )
RETURN IF ( _bal > 0.005, _bal * ( 1 + _dpd / 30 ) * ( 1 + COALESCE ( _risk, 0 ) / 100 ) )
)
Overview page: lockup and the standard AR KPIs up top, DSO against best possible DSO, AR aging, the top past-due clients, and billings against collections.
×
Model view: Employee, Date, Client and Project on top filter the Timesheet, Invoice, Payment and WriteOff facts below. The 92 measures live in their own table, and the helper and what-if tables sit apart on the right.
×
Leakage: a waterfall from $9.27M of standard value down to $7.57M collected, showing where each dollar slips. Most of the gap is cash still sitting in open invoices.
×
Collections: a worklist ranked by balance × days past due × client risk, so the AR team knows who to call first, plus past-due AR by account manager and the collection curve.
×
Client Risk: every client plotted by days to pay against days beyond terms, next to a 0 to 100 risk score built from how late they pay, whether that is getting worse, AR over 60 days and dispute rate.
×
Forecast: expected cash for the next 30, 60 and 90 days, with what-if slicers for payment delays and late fees, plus utilization and margin by role and service line.
×