Tutorial: Microsoft Fabric for Power BI users - Power BI (2023)

  • Article

In this tutorial, you learn how to use Dataflows Gen2 and Pipelines to ingest data into a Lakehouse and create a dimensional model. You also learn how to generate a beautiful report automatically to display the latest sales figures from start to finish in just 45 minutes.

Using a Contoso sample dataset we can build an end-to-end solution in no time.

Let’s get started!

  • Prepare and load data into a lakehouse
  • Build a dimensional model in a lakehouse
  • Automatically create a report with quick create

Prerequisites

  • Before you start, if you aren't signed up yet, sign up for a free trial.
  • Create a new workspace and assign a Fabric capacity.
    • An existing workspace can also be used, although we recommend using a nonproduction workspace for simplicity of the tutorial.
  • Download the Power Query template file that contains sample queries for Contoso data.

Create a lakehouse to store data

We start by creating a lakehouse to store our data, Dataflows Gen2 to prepare and transform columns, and a pipeline to handle the orchestration of a scheduled refresh and e-mail activity.

  1. Navigate to your workspace and select New. Then select Show all.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (1)

  2. In the New item creation screen, select Lakehouse under the Data engineering category.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (2)

  3. Set the Lakehouse name to SalesLakehouse. Then select Create.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (3)

  4. Once you're in the Lakehouse editor, select New Dataflow Gen2.

    Note

    You can also select Get data from the ribbon and then New Dataflow Gen2.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (4)

Prepare and load data into your lakehouse

Take the following steps to load data into your lakehouse:

  1. Once you're in the Power Query Online editor for Dataflows Gen2, select Import from a Power Query template and choose the template file downloaded from the prerequisites.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (5)

  2. Select the DimDate query under the Data load query group and then select on Configure connection. If necessary, set the authentication type to Anonymous before selecting Connect.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (6)

  3. With the DimDate query selected, in the data preview window, change the data type of the DateKey column to Date/Time by selecting the icon in the top left.

    Note

    The lakehouse only supports datetime data types. If you attempt to load date only data, an error message is presented.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (7)

  4. Select Replace current within the Change column type window.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (8)

    (Video) Microsoft Fabric For Power BI Users Tutorial 01 – Getting Started

Add a data destination

Take the following steps to add a data destination:

  1. With the DimDate table selected, from the Home tab, select Add data destination and then select the Lakehouse option menu item.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (9)

  2. If necessary, set the authentication to Organizational account and then select Next.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (10)

  3. From the navigator, select the workspace used for this tutorial and expand to view all Lakehouse items. Select SalesLakehouse and confirm that the default New table is selected before selecting Next to continue.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (11)

  4. Set the Update method to Replace and then select Save settings.

    Caution

    Setting the update method to Replace deletes all existing data and replaces it with the new data on each subsequent refresh.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (12)

In the bottom right corner of the Power Query Online editor, you can find the configured Data destination settings for your query where you can further customize or remove.

Tutorial: Microsoft Fabric for Power BI users - Power BI (13)

Before moving on to the next section of this tutorial, make sure to perform the same steps as you took earlier in this section to configure the Lakehouse as your data destination for each of the following queries.

Query
DimCustomer
DimEmployee
DimProduct
DimStore
  1. Select the FactOnlineSales query under the Data transformation query group and from the Home tab, select Add data destination and then select the Lakehouse option.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (14)

  2. If necessary, set the authentication to Organizational account and then select Next.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (15)

  3. From the navigator, select the workspace used for this tutorial and expand to view all Lakehouse items. Select SalesLakehouse and confirm that the default New table is selected before selecting Next to continue.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (16)

  4. Set the Update method to Append and then select Save settings.

    Note

    This process inserts data, preserving the existing rows within the table on each subsequent refresh.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (17)

  5. Select Publish to save your dataflow and exit the Power Query Online editor.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (18)

  6. Hover above the created dataflow in your workspace, select the ellipses (...) and the Properties option.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (19)

    (Video) Webinar Series: Introduction to Microsoft Fabric

  7. Change the name of the dataflow to OnlineSalesDataflow and select Save.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (20)

Orchestrate a data pipeline

Using pipelines, we first orchestrate the refresh of our data flow. If an error occurs, we send a customized Outlook email that includes important details.

  1. Select the Lakehouse item named SalesLakehouse within your workspace.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (21)

  2. Once you're in the Lakehouse editor, select New data pipeline.

    Note

    You can also select Get data from the ribbon and then New data pipeline.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (22)

  3. Set the pipeline name to SalesPipeline. Then select Create.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (23)

  4. Close the Copy data assistant by selecting Cancel. If you’re prompted to confirm exiting the copy data window, select Yes, cancel.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (24)

  5. Once you’re in the pipeline editor, select Add pipeline activity, and then select Dataflow.

    Note

    You can also select Dataflow from the ribbon.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (25)

  6. Select the dataflow activity within the pipeline editor and change its Name value to OnlineSalesActivity within the General section.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (26)

  7. With the dataflow activity still selected, select Settings and choose OnlineSalesDataflow from the Dataflow list. If necessary to update the list, select the Refresh icon.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (27)

  8. Select the Activities tab and then the Office365 Outlook activity.

    Note

    If a Grant consent window appears, select Ok, sign in with your organizational account and then select Allow access.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (28)

  9. Select the Office365 Outlook activity within the pipeline editor and change its Name value to Mail on failure within the General section.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (29)

    (Video) Microsoft Fabric & Copilot: Create Power BI Reports in Seconds! - End of Power BI Developer Role?

  10. With the Office365 Outlook activity still selected, select Settings. Update the To field to your e-mail address and the Subject to Pipeline failure. Select the Add dynamic content [Alt+Shift+D] for the mail Body.

    Note

    More e-mail configuration options such as From (Send as), Cc, Bcc, Sensitivity label and more are available from Advanced properties.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (30)

  11. In the Pipeline expression builder, paste the following expression code block:

    @concat( 'Pipeline: ' , , '<br>' , 'Workspace: ' , , '<br>' , 'Time: ' , )

    Tutorial: Microsoft Fabric for Power BI users - Power BI (31)

  12. Select System variables and insert the following variables by selecting the corresponding name from the following table.

    Value nameLineSystem variable
    Pipeline:3Pipeline name
    Workspace:6Workspace name

    Tutorial: Microsoft Fabric for Power BI users - Power BI (32)

  13. Select Functions and insert the following function by selecting the corresponding name from the following table. Once complete select OK.

    Value nameLineSystem variable
    Time:9utcnow

    Tutorial: Microsoft Fabric for Power BI users - Power BI (33)

  14. Select OnlineSalesActivity and from the available path options, select and hold the "X" (On fail) to create an arrow that will be dropped on the Mail on failure activity. This activity will now be invoked if the OnlineSalesActivity fails.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (34)

  15. From the Home tab, select Schedule. Once you have updated the following configurations, select Apply to save your changes.

    NameValue
    Scheduled runOn
    RepeatDaily
    Time12:00:00 AM

  16. From the Home tab, select Run. If a dialog window is displayed select the Save and run option to continue.

    To monitor the pipeline’s current status, you can view the Output table, which displays the current activity progress. The table will periodically refresh on its own, or you can manually select the refresh icon to update it.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (37)

When the status returns Succeeded, you can proceed to the next section of the tutorial by returning to your workspace.

Tutorial: Microsoft Fabric for Power BI users - Power BI (38)

Create a semantic model in the Lakehouse

The data you loaded is almost ready for reporting. Let’s first use the SQL endpoint to create relationships and SQL views in our lakehouse. This allows us to easily access our data within a semantic model, which is a metadata model that contains physical database objects that are abstracted and modified into logical dimensions. It's designed to present data for analysis according to the structure of the business.

Create relationships

This model is a star schema that you might see from data warehouses: It resembles a star. The center of the star is a Fact table. The surrounding tables are called Dimension tables, which are related to the Fact table with relationships.

  1. In the workspace view, select the SQL Endpoint item named SalesLakehouse.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (39)

  2. Once in the Explorer, select the Model view at the bottom of the screen to begin creating relationships.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (40)

  3. Create a relationship by dragging and dropping the column CustomerKey from the FactOnlineSales table, to the CustomerKey on the DimCustomer table.

  4. Once in the Create Relationship window ensure that you have selected the correct tables, columns and settings as showing in the following table. Select Confirm to continue.

    Make this relationship activeFrom: Table 1 (column)To: Table 2 (column)CardinalityCross filter direction
    FactOnlineSales (CustomerKey)DimCustomer (CustomerKey)Many to one (*:1)Single

    Tutorial: Microsoft Fabric for Power BI users - Power BI (41)

    (Video) Microsoft Fabric - What & Why?

  5. Perform these same steps for each of the remaining tables and columns listed in the following table to create relationships.

    Make this relationship activeFrom: Table 1 (column)To: Table 2 (column)CardinalityCross filter direction
    FactOnlineSales (ProductKey)DimProduct (ProductKey)Many to one (*:1)Single
    FactOnlineSales (StoreKey)DimStore (StoreKey)Many to one (*:1)Single
    FactOnlineSales (DateKey)DimDate (DateKey)Many to one (*:1)Single
    DimEmployee (StoreKey)DimStore (StoreKey)Many to one (*:1)Both

The following image shows a finished view of the semantic model with all the created relationships included.

Write a measure in DAX

Let's write a basic measure that calculates the total sales amount by due date on the sales order instead of the default order date.

  1. Select the FactOnlineSales table in the Tables folder. On the Home tab, select New measure.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (43)

  2. In the formula editor, copy and paste or type the following measure to calculate the total sales amount. Select the check mark to commit.

    Total Sales Amount = SUM(FactOnlineSales[SalesAmount])

    Tutorial: Microsoft Fabric for Power BI users - Power BI (44)

Create a SQL view

Let’s write a SQL statement that calculates the total sales amount by month. We’ll then save this statement as a view in our lakehouse. This will allow us to easily access the total sales amount by month in the future.

  1. On the Home tab, select New SQL query.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (45)

  2. In the query editor, copy and paste or type the query below to calculate the total sales amount by month number in descending order. Once entered, select Run to view results.

    SELECT MONTH(DateKey) as "MonthNumber",SUM(SalesAmount) as "TotalSalesAmount"FROM FactOnlineSalesGROUP BY MONTH(DateKey)

    Tutorial: Microsoft Fabric for Power BI users - Power BI (46)

  3. Highlight the full query text and select Save as view.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (47)

  4. In the Save as view window, set the View name to TotalSalesByMonth and then select OK.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (48)

  5. In the Explorer, expand the Views section and select TotalSalesByMonth to view the results in the Data preview.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (49)

Once you're done exploring the SQL endpoint editor, you can proceed to the next section of the tutorial by returning to your workspace.

Tutorial: Microsoft Fabric for Power BI users - Power BI (50)

Autocreate a report

Now that you’ve modeled your data, it's time to visualize and explore your data using quick create.

  1. In the workspace view, hover above the item type Dataset (default) and item name SalesLakehouse. Select the ellipses ( … ) and choose Auto-create report.

    A report is automatically generated for you and dynamically updates based upon column selections in the Your data pane.

    • The displayed report may differ from the image below.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (52)

  2. Select Save from the ribbon to save a copy to the current workspace

    • To enter the complete visual authoring experience, you can select Edit on the ribbon.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (53)

  3. In the Save your report dialog box, type Sales Summary in the Enter a name for your report field. Select Save once complete.

    Tutorial: Microsoft Fabric for Power BI users - Power BI (54)

    (Video) What is Microsoft Fabric (Public Preview)?

You can learn more about quick create.

Next steps

Congratulations on completing the tutorial! If you created a workspace for the tutorial, you can choose to delete it now. Alternatively, you can remove the individual items that were created during the tutorial.

We hope this tutorial has shown how Power BI users can easily provide insights into data at any level of scale with Microsoft Fabric.

FAQs

What is the best font for Power BI dashboard? ›

I was helping my client to build a Power BI report, and one of the main requests was that all visuals should use Roboto font. If you ask yourselves why — the answer is quite simple — they are using Roboto font in all their visual solutions, branding, etc.

What software can Power BI integrate with? ›

Power BI Pro integrates with both Microsoft products, and third-party platforms, so users can pull data from wherever they need to. Some popular Microsoft solutions you can connect Power BI to include Exchange, Office 365, Dynamics 365, SharePoint, Excel, Cortana, and Teams.

What tool can you use in Power BI desktop? ›

Power Query: a data mashup and transformation tool. Power Pivot: a memory tabular data modeling tool. Power View: a data visualization tool. Power Map: a 3D geospatial data visualization tool.

What is the cloud version of Power BI called? ›

Sovereign Clouds | Microsoft Power BI.

What is the best font for executive reports? ›

Best Font for Professional Documents

Business proposals, reports, and professional letters can use Serif fonts like Times New Roman and Garamond. Some users who want to be a bit different from the prime fonts for professional documents choose Baskerville.

Videos

1. Microsoft Power BI Tutorial For Beginners✨ | Power BI Full Course 2023 | Learn Power BI
(Amit Chandak Learn Microsoft Fabric, Power BI, SQL)
2. Power BI Update - May 2023
(Microsoft Power BI)
3. Copilot in Power BI Overview
(Microsoft Power BI)
4. Microsoft Fabric Launch Digital Event (Day 1)
(Microsoft Power BI)
5. Empower every BI professional to do more with Microsoft Fabric | OD06
(Microsoft Developer)
6. Microsoft Fabric Lakehouse
(RADACAD)

References

Top Articles
Latest Posts
Article information

Author: Frankie Dare

Last Updated: 10/03/2023

Views: 5846

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.