Power BI

Setting the Model Design in a Data Model

Data Modeling is the fundamental concept to efficient data analysis. This is why our Power BI training in Sydney and Melbourne covers the common issues in data modeling in detail. But if you have missed the Power BI training in Sydney or Melbourne, here’s an archive to guide you through.

https://powerbitraining.com.au/category/data-modeling-issues-and-solutions/

Let’s summarize the concepts covered so far:

Getting Started

For this blog, we will disable the auto detection of relationships by Power BI. This is done to create an environment where you can dive deeply into model creation. Disabling relationship detection is done purely to enhance concept building and is not preferred in ideal conditions.

For a step by step guide on this: https://powerbitraining.com.au/data-model-common-issues-and-solution-power-bi-training-in-sydney-power-bi-training-in-melbourne/

Importing Data

The Importing Data phase of a data modeling involved procuring the right tables that can answer the business question at hand.

To Gathered Data for Data Model contains:

  • Product Sheet: It consists of three columns addressing the product details, i.e., Product Code, Product and Product Type. Each Product has a distinct Product Code and falls under only one Product Type.
  • Product Line Prod Type Sheet: Each Product Type is a subcategory of Product Line. This sheet records the subcategory to category mapping.
  • Product List Sheet: Product list contains the details of each Product and the list price associated per unit.
  • Sales Person Per Product Type Sheet.: This sheet contains details of Sales Person associated with the Sales. There exists a many to many relationships between the sales person and the product.
  • Sales Sheet: Sales sheet contains transactional Data for the Sales.

Now you have five queries loaded in your Query Editor. At this stage your data model should contain five un connected tables as shown in the image below.

Data Model – Common Issues And Solution | Power BI Training In Sydney | Power BI Training In Melbourne

For a step by step guide on this: https://powerbitraining.com.au/data-model-common-issues-and-solution-power-bi-training-in-sydney-power-bi-training-in-melbourne/

Data Preparation

Data Preparation involves ensuring that the data is capable of delivering value.

Data Preparation involves:

  • Checking the data types and data categories.
  • Making sure that all the required columns are present in data set.

Power BI guesses the data type of the column based on top 1000 Rows.

Creating Date Table

Date is an important dimension table in any data model. Date Table can be generated in Power BI using either the CALENDER() function or the CALENDERAUTO() function.

Both of these functions generate a single date column table. However, CALENDER(<start date>,<end date>) requires the starting and ending dates as the arguments to the function. Whereas, CALENDERAUTO() automatically detects the first and last date in the dataset and generates a date table accordingly.

For a step by step guide on this: https://powerbitraining.com.au/data-model-common-issues-and-solution-3-power-bi-training-in-sydney-power-bi-training-in-melbourne/

Setting Model Design

Now that we imported the required data tables and created the date table, it’s time to design a model using this data. But before we design a data model, we will see what does the absence of relationship between these tables looks like.

To understand the effect of absence of a relationship between two tables.

1. Click on the Table visual in the Visualization Pane.

2. Drag the Product Type field from the Products Table to the Values.

3. Drag the Quantity Sold field from the Sales Table to the Values.

Common Modeling issues in Power BI training in Sydney

It can be seen that the visual shows incorrect values as since 1485 products are sold for each product type and the total quantity of products sold is also 1485.

Now, we set the Model Design:

4.Click on the Model Tab in the left Ribbon.

5. Arrange the Sales Table in the middle and all other tables around it.

Each dimension table is linked to another table using its primary key that contains distinct values.

6. Click on the Product Type in the Product Line Prod Type Table and drag to the Product Type Column in the Product Table.

A one-to-many relationship is created. As each Product type falls under one Product line but has multiple Products as its sub categories.

 7. Click on Product Code in the Product list Price Table and drag to the Product Code in the Product Table.

A one-to-one relationship is created. As each Product code has a single price associated with it.

 8. Click on Product Code in the Product Table and drag to the Product Code in the Sales Table.

A one-to-many relationship is created as a single product is sold multiple times in a fact table.

 9. Click on Order Date in the Sales Table and drag to the Date Table.

A many-to-one relation exists because the date table contains a distinct date entry against multiple orders on the same date in the sales table.  

Common Modeling issues in Power BI training in Sydney

Now that we have linked all the other tables and we do not find a key column to link the Sales Person table. Therefore, no relationship has been created for Sales Person table. 

10. Now Click on Report Tab in the left Ribbon.

Common Modeling issues in Power BI training in Sydney

The quantity sold for each product type has been updated.

Conclusion:

Data Modeling consists of pulling the right data into Power BI for smooth analysis. This may seem easy but practically a good data model is the result of good practice and trouble shooting. In this blog post, the concept of setting a good model design has been discussed.

Learning Power BI from Scratch? Get a complete, in-depth introduction to Microsoft Power BI tool by attending our Power BI Basic Training Course.

More Checkouts for Power BI Training in Australia.

Back to list

Leave a Reply

Your email address will not be published. Required fields are marked *