{
  "anchors": [
    {
      "about": "2-letter state/jurisdiction code (PD-003).",
      "format": "usps_state",
      "kind": "geography",
      "name": "state",
      "scope": "universal"
    },
    {
      "about": "EIA utility/respondent number (Form 861 'Utility Number'); joins within the EIA family \u2014 partial vs 860M entity / 923 operator, confidence per the crosswalk ledger (PD-022).",
      "format": "positive_int",
      "kind": "entity",
      "name": "eia_utility_id",
      "scope": "opportunistic"
    }
  ],
  "capability": "power.retail_sales",
  "codebooks": {
    "ba_code": {
      "codes": {
        "AEC": {
          "label": "PowerSouth Energy Cooperative"
        },
        "AECI": {
          "label": "Associated Electric Cooperative, Inc."
        },
        "AESO": {
          "label": "Alberta Electric System Operator"
        },
        "AVA": {
          "label": "Avista Corporation"
        },
        "AVRN": {
          "label": "Avangrid Renewables, LLC"
        },
        "AZPS": {
          "label": "Arizona Public Service Company"
        },
        "BANC": {
          "label": "Balancing Authority of Northern California"
        },
        "BCHA": {
          "label": "British Columbia Hydro and Power Authority"
        },
        "BHBA": {
          "label": "Black Hills Energy"
        },
        "BPAT": {
          "label": "Bonneville Power Administration"
        },
        "CEN": {
          "label": "Centro Nacional de Control de Energia"
        },
        "CFE": {
          "label": "Comision Federal de Electricidad"
        },
        "CHPD": {
          "label": "Public Utility District No. 1 of Chelan County"
        },
        "CISO": {
          "label": "California Independent System Operator"
        },
        "CPLE": {
          "label": "Duke Energy Progress East"
        },
        "CPLW": {
          "label": "Duke Energy Progress West"
        },
        "DEAA": {
          "label": "Arlington Valley, LLC"
        },
        "DOPD": {
          "label": "PUD No. 1 of Douglas County"
        },
        "DUK": {
          "label": "Duke Energy Carolinas"
        },
        "EEI": {
          "label": "Electric Energy, Inc."
        },
        "EPE": {
          "label": "El Paso Electric Company"
        },
        "ERCO": {
          "label": "Electric Reliability Council of Texas, Inc."
        },
        "FMPP": {
          "label": "Florida Municipal Power Pool"
        },
        "FPC": {
          "label": "Duke Energy Florida, Inc."
        },
        "FPL": {
          "label": "Florida Power & Light Co."
        },
        "GCPD": {
          "label": "Public Utility District No. 2 of Grant County, Washington"
        },
        "GLHB": {
          "label": "GridLiance"
        },
        "GRID": {
          "label": "Gridforce Energy Management, LLC"
        },
        "GRIF": {
          "label": "Griffith Energy, LLC"
        },
        "GRMA": {
          "label": "Gila River Power, LLC"
        },
        "GVL": {
          "label": "Gainesville Regional Utilities"
        },
        "GWA": {
          "label": "NaturEner Power Watch, LLC"
        },
        "HGMA": {
          "label": "New Harquahala Generating Company, LLC"
        },
        "HQT": {
          "label": "Hydro-Quebec TransEnergie"
        },
        "HST": {
          "label": "City of Homestead"
        },
        "IESO": {
          "label": "Ontario IESO"
        },
        "IID": {
          "label": "Imperial Irrigation District"
        },
        "IPCO": {
          "label": "Idaho Power Company"
        },
        "ISNE": {
          "label": "ISO New England"
        },
        "JEA": {
          "label": "JEA"
        },
        "LDWP": {
          "label": "Los Angeles Department of Water and Power"
        },
        "LGEE": {
          "label": "Louisville Gas and Electric Company and Kentucky Utilities Company"
        },
        "MHEB": {
          "label": "Manitoba Hydro"
        },
        "MISO": {
          "label": "Midcontinent Independent System Operator, Inc."
        },
        "NBSO": {
          "label": "New Brunswick System Operator"
        },
        "NEVP": {
          "label": "Nevada Power Company"
        },
        "NSB": {
          "label": "Utilities Commission of New Smyrna Beach"
        },
        "NWMT": {
          "label": "NorthWestern Corporation"
        },
        "NYIS": {
          "label": "New York Independent System Operator"
        },
        "OVEC": {
          "label": "Ohio Valley Electric Corporation"
        },
        "PACE": {
          "label": "PacifiCorp East"
        },
        "PACW": {
          "label": "PacifiCorp West"
        },
        "PGE": {
          "label": "Portland General Electric Company"
        },
        "PJM": {
          "label": "PJM Interconnection, LLC"
        },
        "PNM": {
          "label": "Public Service Company of New Mexico"
        },
        "PSCO": {
          "label": "Public Service Company of Colorado"
        },
        "PSEI": {
          "label": "Puget Sound Energy, Inc."
        },
        "SC": {
          "label": "South Carolina Public Service Authority"
        },
        "SCEG": {
          "label": "Dominion Energy South Carolina, Inc."
        },
        "SCL": {
          "label": "Seattle City Light"
        },
        "SEC": {
          "label": "Seminole Electric Cooperative"
        },
        "SEPA": {
          "label": "Southeastern Power Administration"
        },
        "SIKE": {
          "label": "Sikeston Board Of Municipal Utilities"
        },
        "SOCO": {
          "label": "Southern Company Services, Inc. - Trans"
        },
        "SPA": {
          "label": "Southwestern Power Administration"
        },
        "SPC": {
          "label": "Saskatchewan Power Corporation"
        },
        "SRP": {
          "label": "Salt River Project Agricultural Improvement and Power District"
        },
        "SWPP": {
          "label": "Southwest Power Pool"
        },
        "SWPW": {
          "label": "Southwest Power Pool West Balancing Authority Area"
        },
        "TAL": {
          "label": "City of Tallahassee"
        },
        "TEC": {
          "label": "Tampa Electric Company"
        },
        "TEPC": {
          "label": "Tucson Electric Power"
        },
        "TIDC": {
          "label": "Turlock Irrigation District"
        },
        "TPWR": {
          "label": "City of Tacoma, Department of Public Utilities, Light Division"
        },
        "TVA": {
          "label": "Tennessee Valley Authority"
        },
        "WACM": {
          "label": "Western Area Power Administration - Rocky Mountain Region"
        },
        "WALC": {
          "label": "Western Area Power Administration - Desert Southwest Region"
        },
        "WAUE": {
          "label": "Western Area Power Administration - Upper Great Plains East"
        },
        "WAUW": {
          "label": "Western Area Power Administration - Upper Great Plains West"
        },
        "WWA": {
          "label": "NaturEner Wind Watch, LLC"
        },
        "YAD": {
          "label": "Alcoa Power Generating, Inc. - Yadkin Division"
        }
      },
      "coverage": "partial_for_eia861",
      "note": "EIA-861 reports this BA code on the utility\u00d7state row. exascale.build preserves it as source-reported data; it is not an independently validated physical BA-footprint assignment or corrected grid-operator attribution. A balancing authority is not a state. ERCO (ERCOT) lies wholly within Texas and covers ~90% of its load, but state=TX is the larger jurisdiction \u2014 it also includes non-ERCOT El Paso (WECC), the Panhandle (SPP), and East Texas (MISO), a material (~20%+) difference. Use balancing_authority_code for a grid and state for a jurisdiction; they are not interchangeable. When a phrase like 'the Texas grid' is ambiguous between the two, report both readings rather than guessing one (PD-009).",
      "semantics": "source_reported_eia861_utility_row_assignment",
      "source": "EIA-930 reference table BAs sheet."
    },
    "data_type": {
      "codes": {
        "I": {
          "label": "Imputed"
        },
        "O": {
          "label": "Observed"
        }
      },
      "coverage": "complete_for_eia861_data_type_codes",
      "note": "O = Observed, I = Imputed. In the 2024 census every imputed row is one of the state-level Adjustment sentinel rows (PD-023/PD-025).",
      "source": "EIA-861 'Data Type' column (reviewed locked enum)."
    },
    "ownership": {
      "codes": {
        "Behind the Meter": {
          "label": "Behind the Meter"
        },
        "Community Choice Aggregator": {
          "label": "Community Choice Aggregator"
        },
        "Cooperative": {
          "label": "Cooperative"
        },
        "Federal": {
          "label": "Federal"
        },
        "Investor Owned": {
          "label": "Investor Owned"
        },
        "Municipal": {
          "label": "Municipal"
        },
        "Political Subdivision": {
          "label": "Political Subdivision"
        },
        "Retail Power Marketer": {
          "label": "Retail Power Marketer"
        },
        "State": {
          "label": "State"
        },
        "Wholesale Power Marketer": {
          "label": "Wholesale Power Marketer"
        }
      },
      "coverage": "complete_for_eia861_ownership_labels",
      "note": "Sentinel rows (Adjustment/Withheld) carry a blank ownership, served as null.",
      "source": "EIA-861 'Ownership' column (reviewed locked enum, 9 labels)."
    },
    "part": {
      "codes": {
        "A": {
          "label": "Bundled service (energy + delivery)",
          "service_type": "Bundled"
        },
        "B": {
          "label": "Energy-only service (deregulated energy seller)",
          "service_type": "Energy"
        },
        "C": {
          "label": "Delivery-only service (wires company)",
          "service_type": "Delivery"
        },
        "D": {
          "label": "Bundled, behind-the-meter third-party owners",
          "service_type": "Bundled"
        }
      },
      "coverage": "complete_for_eia861_filing_parts",
      "note": "The file's own aggregation law (PD-026): state totals sum Parts A,B,C,D for revenue but only A,B,D for sales and customers \u2014 Part C (Delivery) re-counts energy that Part B (Energy) rows already carry. A result mixing service types carries a service_type_mix scope note with that exact remedy.",
      "source": "EIA-861 Part \u2194 Service Type pairing as printed in the workbook (reviewed locked enum)."
    },
    "sector": {
      "codes": {
        "commercial": {
          "label": "Commercial"
        },
        "industrial": {
          "label": "Industrial"
        },
        "residential": {
          "label": "Residential"
        },
        "total": {
          "label": "In-row TOTAL block (duplicates the four sectors; explicit opt-in)"
        },
        "transportation": {
          "label": "Transportation"
        }
      },
      "coverage": "complete_for_served_eia861_sectors",
      "note": "Default scope is the four customer sectors; the in-row `total` block duplicates them and is excluded unless `sector` names it explicitly (an unpinned sum would double-count). Filter values are case-normalized server-side.",
      "source": "EIA-861 Sales to Ultimate Customers stacked sector blocks (reviewed served enum)."
    }
  },
  "data_point": {
    "does_not_answer": [
      "hourly or peak load \u2014 sales are billed MWh over a year, not load (EIA-930 is the demand atom)",
      "facility-level or data-center-specific load",
      "county-level anything \u2014 service territory carries county names only (deferred decision)",
      "average retail price (cents/kWh) \u2014 deferred by explicit ratified choice (prices x national is its own PD)",
      "net metering / distributed generation, demand response, reliability, meters \u2014 deferred family members",
      "the ~1,700 small short-form (EIA-861S) utilities \u2014 measured at build, 0 of 1,687 short-form respondents appear in this workbook (their sales live in Short_Form, a deferred slice)",
      "monthly freshness \u2014 the EIA-861M sample is a deferred fast-follow facet",
      "generator capacity, plant generation, wholesale prices, transmission",
      "reconciliation against EIA-930 demand or EIA-923 generation (atom-catalog Rule 2)"
    ],
    "grain": "utility_state_sector_annual",
    "id": "power.retail_sales",
    "note": "Demand (EIA-930) and retail sales (EIA-861) are different consumption atoms, never interchangeable: demand is metered grid load \u2014 MW, hourly, balancing-authority grain \u2014 while retail sales are billed energy \u2014 MWh, annual, utility/state/sector grain. They do not reconcile (different quantity, boundary, and population), and neither is a proxy for the other. For a bare 'how much electricity does X use/consume' question with no time or grain signal, surface BOTH readings \u2014 hourly BA-grain demand (power.demand) and annual state-grain retail sales (power.retail_sales) \u2014 rather than answering with one (PD-018/PD-023).",
    "product_spec": "blocks/power_retail_sales/card.md",
    "represented_fact": "EIA-861 reports annual retail electricity sold to ultimate customers \u2014 billed sales (MWh), revenue (thousand dollars), and customer counts \u2014 by utility, state, customer sector (residential/commercial/industrial/transportation/total), filing part, and service type, as a final annual census. Sales are billed energy over the year, not load: they never reconcile with EIA-930 hourly demand (atom-catalog Rule 1/2).",
    "source_basis": [
      "energy.eia.eia861"
    ],
    "source_decisions": [
      "docs/sources/energy/eia/eia861/source-decision.md"
    ]
  },
  "input": {
    "controls": [
      "include_records",
      "include_evidence",
      "limit",
      "order_by",
      "top_n",
      "order"
    ],
    "date_range_params": [],
    "date_ranges": [],
    "filters": [
      "as_of",
      "data_year",
      "state",
      "sector",
      "part",
      "service_type",
      "ownership",
      "ba_code",
      "data_type",
      "eia_utility_id",
      "utility_name",
      "is_adjustment",
      "is_withheld",
      "included_in_default_us_metrics"
    ],
    "group_by": [
      "data_year",
      "state",
      "sector",
      "part",
      "service_type",
      "ownership",
      "ba_code",
      "data_type",
      "eia_utility_id",
      "utility_name"
    ],
    "ranking": {
      "no_ranking": "Omit order_by and top_n to return all groups in group-key order.",
      "order": {
        "default": "desc",
        "valid_values": [
          "desc",
          "asc"
        ]
      },
      "order_by": {
        "accepts": "one of output.metrics",
        "note": "Ranks the groups by a metric (a measure). Not a group_by dimension \u2014 rows already come back grouped by each group_by field.",
        "requires": [
          "group_by"
        ],
        "valid_values": [
          "sales_mwh",
          "revenue_thousand_dollars",
          "customers_count",
          "distinct_utility_count",
          "source_record_count"
        ]
      },
      "top_n": {
        "note": "Keeps the top N groups by order_by; the rest fold into one (other) remainder (additive metrics sum into it, non-additive ones are nulled) so the result still reconciles to summary.totals.",
        "requires": [
          "group_by",
          "order_by"
        ],
        "type": "positive integer"
      }
    }
  },
  "output": {
    "aggregate_citation_fields": [
      "source_id",
      "publisher",
      "source_url",
      "source_file",
      "raw_file_sha256",
      "as_of",
      "source_rows_count",
      "source_rows_sample",
      "verify",
      "lineage_filter"
    ],
    "citation_fields": [
      "source_id",
      "source_url",
      "source_file",
      "sheet",
      "source_row",
      "source_col",
      "raw_file_sha256",
      "as_of"
    ],
    "detail_fields": [
      "source_id",
      "sheet_name",
      "source_record_key",
      "region_scope",
      "included_in_default_us_metrics",
      "is_adjustment",
      "is_withheld",
      "data_year",
      "source_row_number",
      "eia_utility_id",
      "utility_name",
      "part",
      "service_type",
      "data_type",
      "state",
      "ownership",
      "ba_code",
      "sector",
      "measure",
      "unit",
      "value",
      "as_of",
      "raw_file_sha256",
      "citation"
    ],
    "metric_groups": {
      "customers": [
        "customers_count"
      ],
      "entities": [
        "distinct_utility_count"
      ],
      "records": [
        "source_record_count"
      ],
      "revenue": [
        "revenue_thousand_dollars"
      ],
      "sales_mwh": [
        "sales_mwh"
      ]
    },
    "metric_metadata": {
      "customers_count": {
        "additive_across_groups": true,
        "aggregation": "sum",
        "authoritative_total_path": "summary.totals.customers_count",
        "category": "customers",
        "definition": "Sum of EIA-861 annual ultimate-customer counts within the current result scope.",
        "description": "Sum of reported customer counts. A scope mixing service types carries a service_type_mix note (PD-026: customer totals should sum Parts A,B,D \u2014 a deregulated customer appears under both an energy and a delivery filing). Negative values are Adjustment corrections (PD-023).",
        "display_name": "Customer count",
        "display_precision": "Integer.",
        "grain": "utility \u00d7 state \u00d7 sector \u00d7 year measure cell",
        "null_handling": "A measure cell EIA withheld or did not report produces no atom and is absent from the sum; a matched group with no customer atoms returns null; an empty-query summary returns zero.",
        "rollup_behavior": "additive_partition_metric",
        "row_metric_path": "rows[].metrics.customers_count",
        "source_fields": [
          "value"
        ],
        "unit": "count"
      },
      "distinct_utility_count": {
        "additive_across_groups": false,
        "aggregation": "count_distinct",
        "authoritative_total_path": "summary.totals.distinct_utility_count",
        "category": "entities",
        "definition": "Count of distinct EIA utility IDs within the current result scope.",
        "description": "Distinct EIA utility IDs contributing to the current row or summary scope. Sentinel rows (Adjustment 99999 / Withheld 88888) carry NULL eia_utility_id and are never counted (PD-023).",
        "display_name": "Distinct utility count",
        "display_precision": "Integer.",
        "grain": "result scope",
        "null_handling": "Always an integer count.",
        "rollup_behavior": "distinct_entity_count_not_additive",
        "row_metric_path": "rows[].metrics.distinct_utility_count",
        "source_fields": [
          "eia_utility_id"
        ],
        "unit": "count"
      },
      "revenue_thousand_dollars": {
        "additive_across_groups": true,
        "aggregation": "sum",
        "authoritative_total_path": "summary.totals.revenue_thousand_dollars",
        "category": "revenue",
        "definition": "Sum of EIA-861 annual retail revenue (thousand dollars) within the current result scope.",
        "description": "Sum of billed revenue. Signed: negative values are EIA's state-level Adjustment corrections, summed as-is (PD-023). Per the file's own law, revenue totals sum all Parts A,B,C,D (PD-026) \u2014 no service_type caveat applies to revenue.",
        "display_name": "Retail revenue",
        "display_precision": "Values are rounded to 6 decimal places in JSON to remove binary floating-point noise.",
        "grain": "utility \u00d7 state \u00d7 sector \u00d7 year measure cell",
        "null_handling": "A measure cell EIA withheld or did not report produces no atom and is absent from the sum; a matched group with no revenue atoms returns null; an empty-query summary returns zero.",
        "rollup_behavior": "additive_partition_metric",
        "row_metric_path": "rows[].metrics.revenue_thousand_dollars",
        "source_fields": [
          "value"
        ],
        "unit": "thousand USD"
      },
      "sales_mwh": {
        "additive_across_groups": true,
        "aggregation": "sum",
        "authoritative_total_path": "summary.totals.sales_mwh",
        "category": "sales_mwh",
        "definition": "Sum of EIA-861 annual billed retail electricity sales (MWh) within the current result scope.",
        "description": "Sum of billed sales \u2014 energy billed over the year, never hourly load. Signed: negative values are EIA's state-level Adjustment corrections, summed as-is (PD-023). A scope mixing service types carries a service_type_mix note (PD-026: sales totals should sum Parts A,B,D).",
        "display_name": "Retail sales",
        "display_precision": "MWh values are rounded to 6 decimal places in JSON to remove binary floating-point noise.",
        "grain": "utility \u00d7 state \u00d7 sector \u00d7 year measure cell",
        "null_handling": "A measure cell EIA withheld or did not report produces no atom and is absent from the sum; a matched group with no sales_mwh atoms returns null; an empty-query summary returns zero.",
        "rollup_behavior": "additive_partition_metric",
        "row_metric_path": "rows[].metrics.sales_mwh",
        "source_fields": [
          "value"
        ],
        "unit": "MWh"
      },
      "source_record_count": {
        "additive_across_groups": true,
        "aggregation": "count source records",
        "authoritative_total_path": "summary.totals.source_record_count",
        "category": "records",
        "definition": "Count of normalized source rows (measure-cell atoms) contributing to the current result scope.",
        "description": "Number of normalized EIA-861 measure-cell atoms contributing to the value.",
        "display_name": "Source record count",
        "display_precision": "Integer.",
        "grain": "source row",
        "null_handling": "Always an integer count.",
        "rollup_behavior": "additive_partition_metric",
        "row_metric_path": "rows[].metrics.source_record_count",
        "source_fields": [
          "source_record_key"
        ],
        "unit": "count"
      }
    },
    "metrics": [
      "sales_mwh",
      "revenue_thousand_dollars",
      "customers_count",
      "distinct_utility_count",
      "source_record_count"
    ],
    "summary_fields": [
      "group_count",
      "totals"
    ]
  },
  "primitive": "query_power_retail_sales_v1",
  "status": "available"
}
