Skip to main content
    All cases
    Own product · Energy / analytics

    A forecast-versus-actual file becomes a balancing-cost report in one pass

    Upload a forecast-versus-actual export and get total balancing cost, produced volume and average cost per MWh, checked against Latvia's live imbalance prices.

    15 minInterval
    96Intervals per day
    LiveBTD imbalance prices
    1 dayBuild
    Balancing cost chart with the imbalance price overlaid as a dashed line
    Cost per MWh against the imbalance price, same period.
    1. 1Imbalance price, plotted as a dashed overlay
    2. 2Balancing cost per MWh for the same period

    What runs automatically

    01 / PARSE

    Column auto-detection

    Columns are matched by header name across dozens of recognized variants, with a fixed fallback layout when there are none. A multi-sheet workbook picks the tab with the most rows automatically.

    02 / PRICES

    Live BTD price fetch

    The detected period is sent to the Baltic Transparency Dashboard for Latvia's Final imbalance price, through a proxy that enforces an origin allowlist since the API blocks direct browser calls.

    03 / COST

    Cost per interval

    Each interval's imbalance, forecast minus fact, is multiplied by that interval's price. A missing price excludes the interval from the totals instead of interpolating a guess.

    Built with Claude Code in 1 day

    Before

    A forecast export and the published price table were joined by hand.

    After

    One upload returns total cost, volume and average cost per MWh.

    []/More screens
    Sample forecast/fact file after upload, with the detected period and BTD price panel
    Upload: file parsed, period auto-detected, imbalance prices fetched.
    Summary cards: total balancing cost, produced volume and average cost per MWh
    Totals for a sample day: cost, volume and average cost per MWh.
    Under the hood

    01Context

    A forecast miss has a market price

    Latvia settles renewable output against a forecast at 15-minute resolution: any shortfall or surplus is bought or sold back at the market's imbalance price. A producer usually has that price in one place and its own forecast-versus-actual numbers in another, with no easy way to see what a bad forecasting day actually cost.

    02What we built

    Upload a file, get a cost number

    Drop in an Excel or CSV export with a timestamp, forecast and fact column; the app finds the right columns by header name, or by a fixed layout when headers are missing, and detects the covered period automatically. A file up to 50 MB parses entirely in the browser, nothing is uploaded anywhere. The period auto-fills from the file, capped at six months, and the app fetches Latvia's Final imbalance price for that window from the Baltic Transparency Dashboard.

    03How it works

    Client-side parsing, a proxied price feed

    React, TypeScript and Vite on the front end, Recharts for the chart, the xlsx library for parsing. Imbalance volume is forecast minus fact; balancing cost is imbalance volume times the imbalance price; cost per MWh is total cost divided by total produced volume. An interval with no matching price is excluded from the totals rather than interpolated. The Baltic Transparency Dashboard blocks direct browser requests, so a Vercel Edge Function proxies the price call in production.

    ANM SOLUTIONS / CONTACT US

    Want something like this?

    First 30-minute call is free. We scope it, you decide.

    []/More cases