Data Modelling
In this article, we will guide you through the process of data modeling in Power BI step by step.
Topics Covered:
- How to Create a Data Model in Power BI
- Understand Your Data
- Create a New Data Model
- Add Tables to Your Data Model
- Create Relationships b/w Tables
- Define Calculated Columns
- Define Hierarchies
- Test and Refine Your Data Model
- Save and Publish Your Data Model
Step 1: “Understand Your Data”
The first step in data modeling is to understand your data. This involves identifying the tables and fields in your data source understanding the relationships between the tables and defining any calculations or metrics that you want to include in your data model.
Here, is the steps of creating data model in power bi desktop:
Step 1: “Connect to Your Data Source”
Open Power BI Desktop and click on the "Get Data" button on the Home tab in data group. Once you are done with that, it will pop-up a dialog box where it offers a variety of different Data source options, from there you can select “Excel Workbook”.
Once you select, it will redirect you into your computer system, from there you can pick your data file and click on “Open” button located at the bottom right corner of the dialog box.
Step 2: “Add Tables to Your Data Model”
Once you have connected to your data source, you will see a list of available tables. Select the tables you want to add to your data model and click on the "Load" button.
Step 3: “Create Relationships Between Tables”
Click on the "Manage Relationships" button on the Home tab.
To create a relationship, select the first table and the related table from the drop-down menus, then choose the fields you want to use to create the relationship. Click "OK" to create the relationship.
Step 4: “Define Calculated Columns”
Click on the "Modeling" tab and then click on "New Column". Enter a name for your calculated column and the formula you want to use to calculate its values.
Step 6: “Define Hierarchies”
Right click on the "Fields" section and then click on "Create Hierarchy".
Select the field “Sub category” you want to include in your hierarchy.
define the levels of the hierarchy.
- Level 1 — Category
- Level 2 — Sub-category
- Level 3 — Product
Step 7: “Test and Refine Your Data Model”
Once you have defined your calculated columns, measures and hierarchies, test your data model to make sure it is working correctly. If necessary, refine your model based on feedback from stakeholders.
Step 8: “Save and Publish Your Data Model”
- Once you are satisfied with your data model, save it and publish it to Power BI service. To do this, click on the "Home" tab and select "Publish".
If you're not signed in to the Power BI service account, Power BI prompts you to sign in.
- Select the workspace destination to publish the report and dataset to, and choose “Select”.
The publishing process begins, and Power BI Desktop shows the progress.
Once it is completed, Power BI Desktop shows success and provides links to the report in the Power BI service and to quick insights about the report.
Conclusion:
Creating a data model in Power BI involves connecting to your data source, adding tables to your data model, creating relationships between tables, defining calculated columns and defining hierarchies, and refining a model, saving and publishing it to Power BI service. By following these steps, you can create a robust data model that enables you to analyze your data effectively and create impactful reports and visualizations.