Explore real-time analytics in Microsoft Fabric

In this exercise you’ll explore real-time analytics in Microsoft Fabric.

This lab will take approximately 25 minutes to complete.

Note: You’ll need a Microsoft Fabric license to complete this exercise. See Getting started with Fabric for details of how to enable a free Fabric trial license. You will need a Microsoft school or work account to do this. If you don’t have one, you can sign up for a trial of Microsoft Office 365 E3 or higher.

Create a workspace

Before working with data in Fabric, create a workspace with the Fabric trial enabled.

  1. Sign into Microsoft Fabric at https://app.fabric.microsoft.com.
  2. In the menu bar on the left, select Workspaces (the icon looks similar to 🗇).
  3. Create a new workspace with a name of your choice, selecting a licensing mode in the Advanced section that includes Fabric capacity (Trial, Premium, or Fabric).
  4. When your new workspace opens, it should be empty.

    Screenshot of an empty workspace in Power BI.

Create a KQL database

Now that you have a workspace, you can create a KQL database to store real-time data.

  1. At the bottom left of the portal, switch to the Real-Time Intelligence experience.

    Screenshot of the experience switcher menu.

    The Real-Time Intelligence home page includes tiles to create commonly used assets for real-time data analysis.

  2. In the Real-Time Intelligence home page, create a new Eventhouse with a name of your choice.

    Screenshot of the RTA Editor with Create KQL DB Highlighted.

    The Eventhouse is used to group and manage your databases across projects. An empty KQL database is automatically created with the eventhouse’s name and we will add data to it later in this exercise.

Create an eventstream

Eventstreams provide a scalable and flexible way to ingest real-time data from a streaming source.

  1. In the menu bar on the left, select the Home page for the Real-Time Intelligence experience.
  2. On the home page, select the tile to create a new Eventstream with a name of your choice.

    After a short time, the visual designer for your eventstream is displayed.

    Screenshot of the Eventstream designer.

    The visual designer canvas shows a source that connects to your eventstream, which in turn is connected to a destination.

  3. On the designer canvas, in the New source list for your source, select Sample data. Then in the Sample data pane, specify the name taxis and select the Yellow Taxi sample data (which represents data collected from taxi journeys). Then select Add.
  4. Beneath the designer canvas, select the Data preview tab to preview the data being streamed from the source:

    Screenshot of the Eventstream data preview.

  5. On the designer canvas, in the New destination list for your destination, select KQL database. Then in the KQL database pane, specify the destination name taxi-data and select your workspace and KQL database. Select Create new under Destination table and enter the table name taxi-data. Then select Add.
  6. Verify that your completed eventstream looks like this:

    Screenshot of a completed Eventstream.

Query real-time data in a KQL database

Your eventstream continuously populates a table in your KQL database, enabling you to query the real-time data.

  1. In the menu hub on the left, select your KQL database (or select your workspace and find your KQL database there).
  2. In the menu for the taxi-data table (which has been created by your eventstream), select Query table > Records ingested in the last 24 hours.

    Screenshot of the Query table menu in a KQL database.

  3. View the results of the query, which should be a KQL query like this:

     | where ingestion_time() between (now(-1d) .. now())

    The results show all taxi records ingested from the streaming source in the last 24 hours.

  4. Replace all of the KQL query code in the top half of the query editor with the following code:

     // This query returns the number of taxi pickups per hour
     | summarize PickupCount = count() by bin(todatetime(tpep_pickup_datetime), 1h)
  5. Use the ▷ Run button to run the query and review the results, which show the number of taxi pickups for each hour.

Clean up resources

If you’ve finished exploring real-time analytics in Microsoft Fabric, you can delete the workspace you created for this exercise.

  1. In the bar on the left, select the icon for your workspace to view all of the items it contains.
  2. In the menu on the toolbar, select Workspace settings.
  3. In the Other section, select Remove this workspace.