Skip to content

Order History Analysis

Business Context

A retail operations analyst compares accepted orders across stores to understand order volume and value. The order system records each order, while the analyst works from periodic exports. This example starts with two stores and a small set of synthetic orders; it does not assume an integration with a real retailer.

%%{init: {"themeCSS": "\nsvg { max-width: none !important; }\n.nodeLabel, .edgeLabel, .cluster-label { font-size: 14px !important; }\n.edgeLabel, .edgeLabel p, .labelBkg { background: transparent !important; }\n.edgeLabel rect, .labelBkg { fill: transparent !important; }\n.nodeLabel, .edgeLabel, .cluster-label { color: var(--md-mermaid-label-fg-color); }\n.cluster-label span, .cluster-label p { color: var(--md-mermaid-label-fg-color) !important; }\n.cluster rect { fill: transparent; stroke: var(--md-mermaid-node-fg-color); }\n.node rect, .node circle, .node ellipse, .node polygon, .node path {\n  fill: var(--md-mermaid-node-bg-color);\n  stroke: var(--md-mermaid-node-fg-color);\n}\n.flowchart-link { stroke: var(--md-mermaid-edge-color); }\nmarker path { fill: var(--md-mermaid-edge-color); }\n", "themeVariables": {"fontFamily": "var(--md-text-font-family)", "fontSize": "14px"}, "flowchart": {"useMaxWidth": false, "htmlLabels": true, "diagramPadding": 16, "nodeSpacing": 32, "rankSpacing": 72, "padding": 8, "subGraphTitleMargin": {"top": 8, "bottom": 64}}}}%%
flowchart TB
    P["<b>Order processing</b><br/>Accepts customer orders"]
    O[("<b>Order records</b><br/>Store, value and placement time")]
    subgraph GAP["Gap: Store comparisons wait<br/>for a separate order export"]
        X[("<b>Comparison extract</b><br/>Periodically copied orders")]:::businessGap
        A["<b>Operations analyst</b><br/>Compares orders by store"]:::businessGap
    end
    P -->|"Accepted orders"| O
    O -->|"Periodic export"| X
    X -->|"Order totals"| A
    classDef businessGap fill:#fff4ce,stroke:#b77900,stroke-width:2px
    style GAP fill:transparent,stroke:#b77900,stroke-width:2px

Current Problem

The comparison depends on preparing another extract before analysis can begin. The order facts already exist, but they are not yet available as a shared history of business activity. Repeating the export also makes it easy to mix different runs of a learning exercise or count the same order more than once.

Improved Business Response

An independent history consumer records accepted order findings so the analyst can compare stores without requesting a new export from the publisher. Each accepted order is shared as a Business Event with a consistent meaning. A run identifier separates exercises, and an order identifier supports counting each order once within a run.

%%{init: {"themeCSS": "\nsvg { max-width: none !important; }\n.nodeLabel, .edgeLabel, .cluster-label { font-size: 14px !important; }\n.edgeLabel, .edgeLabel p, .labelBkg { background: transparent !important; }\n.edgeLabel rect, .labelBkg { fill: transparent !important; }\n.nodeLabel, .edgeLabel, .cluster-label { color: var(--md-mermaid-label-fg-color); }\n.cluster-label span, .cluster-label p { color: var(--md-mermaid-label-fg-color) !important; }\n.cluster rect { fill: transparent; stroke: var(--md-mermaid-node-fg-color); }\n.node rect, .node circle, .node ellipse, .node polygon, .node path {\n  fill: var(--md-mermaid-node-bg-color);\n  stroke: var(--md-mermaid-node-fg-color);\n}\n.flowchart-link { stroke: var(--md-mermaid-edge-color); }\nmarker path { fill: var(--md-mermaid-edge-color); }\n", "themeVariables": {"fontFamily": "var(--md-text-font-family)", "fontSize": "14px"}, "flowchart": {"useMaxWidth": false, "htmlLabels": true, "diagramPadding": 16, "nodeSpacing": 32, "rankSpacing": 72, "padding": 8, "subGraphTitleMargin": {"top": 8, "bottom": 64}}}}%%
flowchart TB
    P["<b>Order processing</b><br/>Accepts customer orders"]
    BE(["<b>Business Event</b><br/>An order was placed"])
    subgraph VALUE["Improvement: Shared order history<br/>supports repeatable store comparisons"]
        H[("<b>Order history</b><br/>Received order facts")]:::businessValue
        A["<b>Operations analyst</b><br/>Compares order volume and value"]:::businessValue
    end
    P -->|"Order facts"| BE
    BE -->|"Accepted order"| H
    H -->|"Orders grouped by store"| A
    classDef businessValue fill:#dff6dd,stroke:#107c10,stroke-width:2px
    style VALUE fill:transparent,stroke:#107c10,stroke-width:2px

Event-driven architecture

Business signal: Retail.Orders.OrderPlaced
Publisher: Notebook
Consumer: Eventhouse, through Analyze in Eventhouse
Level: Beginner - guided native setup and one result query

%%{init: {"themeCSS": "\nsvg { max-width: none !important; }\n.nodeLabel, .edgeLabel, .cluster-label { font-size: 14px !important; }\n.edgeLabel, .edgeLabel p, .labelBkg { background: transparent !important; }\n.edgeLabel rect, .labelBkg { fill: transparent !important; }\n.nodeLabel, .edgeLabel, .cluster-label { color: var(--md-mermaid-label-fg-color); }\n.cluster-label span, .cluster-label p { color: var(--md-mermaid-label-fg-color) !important; }\n.cluster rect { fill: transparent; stroke: var(--md-mermaid-node-fg-color); }\n.node rect, .node circle, .node ellipse, .node polygon, .node path {\n  fill: var(--md-mermaid-node-bg-color);\n  stroke: var(--md-mermaid-node-fg-color);\n}\n.flowchart-link { stroke: var(--md-mermaid-edge-color); }\nmarker path { fill: var(--md-mermaid-edge-color); }\n", "themeVariables": {"fontFamily": "var(--md-text-font-family)", "fontSize": "14px"}, "flowchart": {"useMaxWidth": false, "htmlLabels": true, "diagramPadding": 16, "nodeSpacing": 32, "rankSpacing": 72, "padding": 8, "subGraphTitleMargin": {"top": 8, "bottom": 64}}}}%%
flowchart TB
    N["<b>Notebook</b><br/>Publishes six synthetic orders"]
    BE(["<b>Business Event</b><br/>Order placed"])
    EH[("<b>Eventhouse</b><br/>Managed order-event history")]
    Q["<b>KQL query</b><br/>Counts orders and sums value by store"]
    N -->|"Order payloads"| BE
    BE -->|"Analyze in Eventhouse"| EH
    EH -->|"Received rows for one sample run"| Q
  1. The Notebook publishes six synthetic orders using the documented Business Events API.
  2. Analyze in Eventhouse, selected during event creation, creates a dedicated KQL table and persists received events. This is the required history consumer, not an optional extension or a database populated directly by the Notebook.
  3. The analyst filters one sample run, deduplicates its order identifiers and compares the two stores.

The Workbook contains the schema, source cell, query and exact expected results. Setup uses the native Fabric interface; there is no deployment package or automatic provisioning claim.

Business outcome and boundaries

The exercise ends with six distinct orders, three per store, and USD 900 in total order value visible in the history query. North contributes USD 350 and South USD 550.

Where the exercise stops: these are placed-order values, not recognized revenue, collected payments or fulfilled orders. A history row proves receipt by the history consumer, not completion of another business action. The query's sample-specific deduplication is not an exactly-once delivery guarantee or a general reconciliation strategy.

No Activator rule, Teams message, Power Automate flow, production order system or external customer data is needed.

Try the Workbook

Open the Workbook to create the event with managed history, publish one sample and inspect the store comparison.

What are you building?

Ask a question, share your scenario, or help shape the next developer guide.

Join the conversation on Reddit →

Ask in our community

Join developers discussing Microsoft Fabric on Reddit.
Not a member yet? Join r/MicrosoftFabric.