Tutorial: Create Power BI visualizations from Microsoft Fabric HorizonDB data

In this tutorial step, you create a Power BI semantic model and report from the Fabric HorizonDB mirrored analytical copy.

Important

Fabric HorizonDB is in public preview. Capabilities, limits, and behavior might change before general availability. For more information, see Microsoft Fabric preview features.

Prerequisites

Build the report from the SQL analytics endpoint. Don't connect the report directly to the operational PostgreSQL endpoint for this tutorial.

The current preview permits PostgreSQL connections only from the database creator. Report access is a separate analytical permission boundary and doesn't enable additional PostgreSQL identities.

Create the semantic model

  1. Open the SQL analytics endpoint associated with contoso-orders-db.
  2. Start the action to create a new Power BI semantic model.
  3. Select the mirrored customers and orders tables from the schema shown by the endpoint.
  4. Enter contoso-orders-model as the semantic model name.
  5. Create the model.
  6. Open the model view.
  7. Confirm that customers[customer_id] relates to orders[customer_id].
  8. If the relationship isn't detected, create a one-to-many relationship from customers[customer_id] to orders[customer_id].
  9. Confirm that the order total column uses a decimal numeric type and isn't summarized as text.

When the experience offers Direct Lake for this source, the model queries the OneLake analytical representation rather than the Fabric HorizonDB PostgreSQL endpoint.

Create measures

In the semantic model, create these measures:

Order count = COUNTROWS('orders')
Order total = SUM('orders'[total])
Latest source timestamp = MAX('orders'[created_at])

The latest source timestamp is the newest source timestamp present in the model. It doesn't prove that mirroring has no lag.

Create the report

  1. From contoso-orders-model, create a blank report.
  2. Save it as contoso-order-operations.
  3. Add a card visual with Order count.
  4. Add a card visual with Order total.
  5. Add a card visual with Latest source timestamp.
  6. Add a column or bar chart:
    • Put orders[status] on the category axis.
    • Put Order total on the value axis.
  7. Add a table visual with:
    • Add orders[order_reference] as a column.
    • Add customers[customer_name] as a column.
    • Add orders[order_date] as a column.
    • Add orders[status] as a column.
    • Add orders[total] as a column.
  8. Sort the table by order date, descending.
  9. Save the report.

For the unchanged tutorial data, the cards show an order count of 3 and an order total of 2655.75.

Validate the report

Compare the report totals with this query on the SQL analytics endpoint:

SELECT
    COUNT(*) AS order_count,
    SUM(total) AS order_total,
    MAX(created_at) AS latest_source_timestamp
FROM horizon_sample.orders;

Use the actual mirrored schema name if it differs.

If the report and endpoint disagree:

  1. Refresh model metadata if the source schema changed.
  2. Check filters, relationships, column types, and measure definitions.
  3. Check mirroring freshness separately.
  4. Don't redirect reporting queries to PostgreSQL as a workaround for delayed mirroring.

Review report security

Fabric HorizonDB permissions aren't automatically reproduced on the mirrored analytical surface.

Before sharing the report:

  1. Identify who needs the report and semantic model.
  2. Grant only the required report, model, endpoint, and source permissions.
  3. Apply and test any required model security.
  4. Verify access with a non-owner test identity.

For more information, see Secure mirrored Fabric HorizonDB data.

Expected outcome

The workspace contains contoso-orders-model and contoso-order-operations. The report shows the order count, order total, latest mirrored source timestamp, totals by status, and individual order details.

Next step