<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayam Abuga</title>
    <description>The latest articles on DEV Community by Ayam Abuga (@ayam_abuga_93093d63764982).</description>
    <link>https://dev.to/ayam_abuga_93093d63764982</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4075084%2Fa2fb22cc-2cd7-43e1-b951-0ef5363c904d.jpg</url>
      <title>DEV Community: Ayam Abuga</title>
      <link>https://dev.to/ayam_abuga_93093d63764982</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayam_abuga_93093d63764982"/>
    <language>en</language>
    <item>
      <title>Power BI Data Modelling Explained !</title>
      <dc:creator>Ayam Abuga</dc:creator>
      <pubDate>Sun, 13 Sep 2026 12:44:14 +0000</pubDate>
      <link>https://dev.to/ayam_abuga_93093d63764982/power-bi-data-modelling-explained--24k2</link>
      <guid>https://dev.to/ayam_abuga_93093d63764982/power-bi-data-modelling-explained--24k2</guid>
      <description>&lt;h1&gt;
  
  
  Schemas, Relationships, Filter Direction and Joins
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;If your Power BI dashboard looks great but your numbers are wrong, the problem may not be your DAX. It may be your data model :)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When building a Power BI report, it is tempting to focus on charts, slicers and dashboards. But underneath every reliable Power BI report is a well-designed data model.&lt;/p&gt;

&lt;p&gt;Your model determines how tables communicate, how filters travel, how DAX calculations behave, and how easily your report can scale as the amount of data grows.&lt;/p&gt;

&lt;p&gt;In this article, we'll build a practical understanding of &lt;strong&gt;data modelling, fact and dimension tables, schemas, relationships, filter direction and Power Query joins&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Data Modelling Matters
&lt;/h2&gt;

&lt;p&gt;Imagine a retail company with millions of sales transactions.&lt;/p&gt;

&lt;p&gt;Every transaction contains information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer&lt;/li&gt;
&lt;li&gt;Product&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Quantity&lt;/li&gt;
&lt;li&gt;Sales amount&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One option is to put everything into one enormous table.&lt;/p&gt;

&lt;p&gt;Another option is to separate the data into logical tables and connect them.&lt;/p&gt;

&lt;p&gt;That second approach is usually much better for business intelligence.&lt;/p&gt;

&lt;p&gt;A good Power BI model provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Better performance&lt;/strong&gt; when querying large datasets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simpler DAX&lt;/strong&gt; calculations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clearer reports&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Less data duplication&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Predictable filtering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Better scalability&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Easier maintenance&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A useful way to think about modelling is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The fact table tells you what happened. Dimension tables tell you who, what, when and where it happened.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  1. Three Common Data Modelling Schemas
&lt;/h1&gt;

&lt;p&gt;There are three structures you'll commonly encounter: &lt;strong&gt;flat tables, star schemas and snowflake schemas&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flat Table
&lt;/h2&gt;

&lt;p&gt;A flat table puts everything into one table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────┐
│                  SalesData                   │
├─────────┬──────────┬──────────┬─────────────┤
│ OrderID │ Customer │ Product  │ SalesAmount │
├─────────┼──────────┼──────────┼─────────────┤
│ 1001    │ John     │ Laptop   │ 80000       │
│ 1002    │ Mary     │ Mouse    │ 2000        │
│ 1003    │ John     │ Laptop   │ 80000       │
└─────────┴──────────┴──────────┴─────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The good
&lt;/h3&gt;

&lt;p&gt;Flat tables are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to understand&lt;/li&gt;
&lt;li&gt;Easy to import&lt;/li&gt;
&lt;li&gt;Suitable for small datasets&lt;/li&gt;
&lt;li&gt;Useful for simple reports&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The problem
&lt;/h3&gt;

&lt;p&gt;They create a lot of repetition.&lt;/p&gt;

&lt;p&gt;If John makes 1,000 purchases, his name, location and other attributes may be repeated across 1,000 rows.&lt;/p&gt;

&lt;p&gt;As the dataset grows, the table can become very wide and difficult to maintain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use a flat table when:&lt;/strong&gt; the dataset is small and the analysis is simple.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Star Schema
&lt;/h1&gt;

&lt;p&gt;The star schema is generally the preferred design for Power BI analytical models.&lt;/p&gt;

&lt;p&gt;It contains a central fact table surrounded by dimension tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    ┌──────────────┐
                    │   DimDate    │
                    └──────┬───────┘
                           │ 1
                           │
                           ▼ *
┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│ DimCustomer  │1 ─►│  FactSales   │◄─ 1│  DimProduct  │
└──────────────┘    └──────┬───────┘    └──────────────┘
                           │ *
                           │
                           ▼ 1
                    ┌──────────────┐
                    │ DimLocation  │
                    └──────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fact table contains measurable events.&lt;/p&gt;

&lt;p&gt;The dimensions describe those events.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FactSales
-----------------
SalesID
DateKey
CustomerID
ProductID
LocationID
Quantity
SalesAmount
CostAmount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimProduct
-----------------
ProductID
ProductName
Category
Brand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can write a simple measure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Sales =
SUM(FactSales[SalesAmount])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;DimProduct[Category]&lt;/code&gt; can filter the sales measure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why star schemas work so well
&lt;/h3&gt;

&lt;p&gt;They provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple relationships&lt;/li&gt;
&lt;li&gt;Good performance&lt;/li&gt;
&lt;li&gt;Easier DAX&lt;/li&gt;
&lt;li&gt;Low redundancy&lt;/li&gt;
&lt;li&gt;Clear filter paths&lt;/li&gt;
&lt;li&gt;Excellent scalability&lt;/li&gt;
&lt;li&gt;Easier report development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For most Power BI projects, &lt;strong&gt;start with a star schema unless you have a specific reason not to&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Snowflake Schema
&lt;/h1&gt;

&lt;p&gt;A snowflake schema takes the star schema and further separates dimensions.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCountry
     │
     ▼
DimRegion
     │
     ▼
DimCity
     │
     ▼
FactSales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of storing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimLocation
-----------------
City
Region
Country
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you might create separate tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;p&gt;Snowflake schemas can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce redundancy&lt;/li&gt;
&lt;li&gt;Represent complex hierarchies&lt;/li&gt;
&lt;li&gt;Work well with highly structured source systems&lt;/li&gt;
&lt;li&gt;Separate independently maintained entities&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;p&gt;The additional tables introduce more relationships.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More complex filtering&lt;/li&gt;
&lt;li&gt;More complicated models&lt;/li&gt;
&lt;li&gt;Potentially more difficult DAX&lt;/li&gt;
&lt;li&gt;More effort for report developers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a Power BI reporting model, I would generally favour a &lt;strong&gt;star schema over unnecessary snowflaking&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Fact Tables vs Dimension Tables
&lt;/h1&gt;

&lt;p&gt;This distinction is fundamental.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fact Tables
&lt;/h2&gt;

&lt;p&gt;A fact table stores business events.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;FactSales&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FactOrders&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FactTransactions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FactInventory&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A sales fact table might contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SalesID
DateKey
CustomerID
ProductID
Quantity
UnitPrice
Discount
SalesAmount
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These numeric fields can be aggregated.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Quantity =
SUM(FactSales[Quantity])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Sales =
SUM(FactSales[SalesAmount])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dimension Tables
&lt;/h2&gt;

&lt;p&gt;Dimension tables contain descriptive attributes.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer
-----------------
CustomerID
CustomerName
Segment
City
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimProduct
-----------------
ProductID
ProductName
Category
Brand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimDate
-----------------
DateKey
Date
Month
Quarter
Year
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimLocation
-----------------
LocationID
City
Region
Country
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The simplest mental model is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Answers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fact&lt;/td&gt;
&lt;td&gt;What happened?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customer dimension&lt;/td&gt;
&lt;td&gt;Who?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product dimension&lt;/td&gt;
&lt;td&gt;What?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Date dimension&lt;/td&gt;
&lt;td&gt;When?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Location dimension&lt;/td&gt;
&lt;td&gt;Where?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  5. Don't Ignore Fact Table Grain
&lt;/h1&gt;

&lt;p&gt;One of the easiest ways to create incorrect Power BI calculations is to misunderstand &lt;strong&gt;grain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Grain means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What exactly does one row represent?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Suppose an order contains three products.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order 1001
├── Laptop
├── Mouse
└── Keyboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the fact table grain is &lt;em&gt;one row per order line&lt;/em&gt;, the data could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderID   Product    Quantity
1001      Laptop     1
1001      Mouse      2
1001      Keyboard   1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The order appears three times.&lt;/p&gt;

&lt;p&gt;That's correct because the grain is the order line.&lt;/p&gt;

&lt;p&gt;If you incorrectly assume the grain is "one row per order", you may accidentally double-count revenue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always define the grain before building your relationships and measures.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Relationships in Power BI
&lt;/h1&gt;

&lt;p&gt;Relationships tell Power BI how tables are connected.&lt;/p&gt;

&lt;p&gt;The most common relationship is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer  1 ───────── * FactSales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One customer can have many sales.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer

CustomerID
C001
C002
C003
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But FactSales might contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SalesID   CustomerID
1001      C001
1002      C001
1003      C002
1004      C001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;C001&lt;/code&gt; is unique in the dimension but appears multiple times in the fact table.&lt;/p&gt;

&lt;p&gt;That's exactly what we want.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Relationship Cardinality
&lt;/h1&gt;

&lt;h2&gt;
  
  
  One-to-Many (1:*)
&lt;/h2&gt;

&lt;p&gt;The standard star-schema relationship.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimProduct  1 ───────── * FactSales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One product can appear in many sales transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this frequently.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  One-to-One (1:1)
&lt;/h2&gt;

&lt;p&gt;Each record on one side corresponds to one record on the other.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CustomerBasic  1 ───── 1 CustomerContact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can be useful when logically separate information is maintained in separate tables.&lt;/p&gt;

&lt;p&gt;However, don't create a 1:1 relationship simply because you can. If two tables can logically be one table, combining them may be simpler.&lt;/p&gt;




&lt;h2&gt;
  
  
  Many-to-Many (&lt;em&gt;:&lt;/em&gt;)
&lt;/h2&gt;

&lt;p&gt;Multiple records on both sides can match.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Student  * ───────── * Course
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A student can take multiple courses, while a course can contain multiple students.&lt;/p&gt;

&lt;p&gt;In BI models, many-to-many relationships require caution because they can create ambiguous filter paths.&lt;/p&gt;

&lt;p&gt;A bridge table is often safer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimStudent  1 ── * Enrollment * ── 1 DimCourse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  8. Primary Keys and Foreign Keys
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;primary key&lt;/strong&gt; uniquely identifies a row.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer

CustomerID
----------
C001
C002
C003
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;strong&gt;foreign key&lt;/strong&gt; references that identifier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FactSales

CustomerID
----------
C001
C001
C002
C001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why the relationship is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CustomerID
   1
   │
   │
   *
CustomerID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dimension must normally contain unique keys.&lt;/p&gt;

&lt;p&gt;The fact table can contain repeated foreign keys.&lt;/p&gt;

&lt;p&gt;If FactSales contains &lt;code&gt;C999&lt;/code&gt;, but &lt;code&gt;C999&lt;/code&gt; doesn't exist in DimCustomer, you have a referential-integrity problem.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Active vs Inactive Relationships
&lt;/h1&gt;

&lt;p&gt;Sometimes a fact table contains multiple dates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FactSales

OrderDate
ShipDate
DeliveryDate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A Date dimension could have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimDate ─── Active ─── FactSales[OrderDate]

DimDate ─── Inactive ─ FactSales[ShipDate]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An inactive relationship isn't useless. It can be activated inside a DAX calculation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sales by Ship Date =
CALCULATE(
    [Total Sales],
    USERELATIONSHIP(
        DimDate[Date],
        FactSales[ShipDate]
    )
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows one Date dimension to support multiple date roles.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Filter Direction
&lt;/h1&gt;

&lt;p&gt;Relationships also control how filters move.&lt;/p&gt;

&lt;p&gt;The normal star-schema pattern is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimProduct
     │
     │ Filter
     ▼
FactSales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose the user selects:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Category = Electronics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Power BI filters &lt;code&gt;DimProduct&lt;/code&gt;, which then filters the matching rows in &lt;code&gt;FactSales&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The sales measure automatically responds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Sales =
SUM(FactSales[SalesAmount])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Single Direction
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dimension ─────────► Fact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should normally be your default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bidirectional
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dimension ◄────────► Fact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filters can move in both directions.&lt;/p&gt;

&lt;p&gt;Bidirectional filtering can be useful in specific scenarios, but overusing it can cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ambiguous filter paths&lt;/li&gt;
&lt;li&gt;Unexpected results&lt;/li&gt;
&lt;li&gt;Hard-to-debug calculations&lt;/li&gt;
&lt;li&gt;More complex models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good rule is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Use single-direction filtering by default. Add bidirectional filtering only when you can explain exactly why you need it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  11. Joins in Power Query
&lt;/h1&gt;

&lt;p&gt;Relationships aren't the only way Power BI works with multiple tables.&lt;/p&gt;

&lt;p&gt;Power Query provides &lt;strong&gt;Merge Queries&lt;/strong&gt;, which performs joins during the data transformation stage.&lt;/p&gt;

&lt;p&gt;Consider:&lt;/p&gt;

&lt;h3&gt;
  
  
  Customers
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CustomerID   Name
C001         John
C002         Mary
C003         Peter
C004         Jane
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Orders
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderID   CustomerID
1001      C001
1002      C001
1003      C002
1004      C005
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can join them using &lt;code&gt;CustomerID&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Left Outer Join
&lt;/h2&gt;

&lt;p&gt;Keeps all records from the left table and matching records from the right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C001 → Order
C002 → Order
C003 → No Order
C004 → No Order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for finding &lt;strong&gt;all customers and their orders&lt;/strong&gt;, including customers who have never ordered.&lt;/p&gt;




&lt;h2&gt;
  
  
  Right Outer Join
&lt;/h2&gt;

&lt;p&gt;Keeps all records from the right table and matching records from the left.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C001 → John
C002 → Mary
C005 → No Customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful when all records from the right-hand table must be retained.&lt;/p&gt;




&lt;h2&gt;
  
  
  Full Outer Join
&lt;/h2&gt;

&lt;p&gt;Keeps everything from both tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C001 → John
C002 → Mary
C003 → Peter
C004 → Jane
C005 → No Customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for data reconciliation and identifying unmatched records.&lt;/p&gt;




&lt;h2&gt;
  
  
  Inner Join
&lt;/h2&gt;

&lt;p&gt;Keeps only matching records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C001 → John
C002 → Mary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful when you only want records that exist in both datasets.&lt;/p&gt;




&lt;h2&gt;
  
  
  Left Anti Join
&lt;/h2&gt;

&lt;p&gt;Returns records from the left table that don't exist in the right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C003 → Peter
C004 → Jane
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Which customers don't have orders?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Right Anti Join
&lt;/h2&gt;

&lt;p&gt;Returns records from the right table that don't exist in the left.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C005 → Order 1004
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Which orders belong to customers missing from the customer table?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Join Cheat Sheet
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Join&lt;/th&gt;
&lt;th&gt;Keeps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Left Outer&lt;/td&gt;
&lt;td&gt;Everything on left + matches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Right Outer&lt;/td&gt;
&lt;td&gt;Everything on right + matches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full Outer&lt;/td&gt;
&lt;td&gt;Everything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inner&lt;/td&gt;
&lt;td&gt;Matches only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Left Anti&lt;/td&gt;
&lt;td&gt;Left-side unmatched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Right Anti&lt;/td&gt;
&lt;td&gt;Right-side unmatched&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  12. Merge vs Relationship: Don't Confuse Them
&lt;/h1&gt;

&lt;p&gt;This is one of the most important Power BI concepts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Power Query Merge
&lt;/h3&gt;

&lt;p&gt;A merge physically combines data during transformation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customers + CustomerDetails
          ↓
    Combined Query
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Columns from one table can become part of the resulting query.&lt;/p&gt;

&lt;h3&gt;
  
  
  Power BI Relationship
&lt;/h3&gt;

&lt;p&gt;A relationship keeps tables separate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer  1 ───────── * FactSales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing is physically copied into the other table.&lt;/p&gt;

&lt;p&gt;Instead, Power BI uses the relationship to propagate filters.&lt;/p&gt;

&lt;p&gt;Think of it this way:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Merge = combine the data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relationship = connect the data.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  13. When Should You Merge?
&lt;/h1&gt;

&lt;p&gt;Use a merge when two datasets logically belong together or when transformation requirements make it appropriate.&lt;/p&gt;

&lt;p&gt;However, don't automatically merge every table.&lt;/p&gt;

&lt;p&gt;For example, putting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CustomerName
CustomerCity
CustomerSegment
ProductName
ProductCategory
Brand
Country
Region
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into every sales row creates a very wide fact table.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DimCustomer ──► FactSales ◄── DimProduct
                         ▲
                         │
                      DimDate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;keeps descriptive information separate.&lt;/p&gt;

&lt;p&gt;This reduces redundancy and produces a cleaner analytical model.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. The Model I Would Build
&lt;/h1&gt;

&lt;p&gt;For a typical retail BI project, my model would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    ┌─────────────┐
                    │   DimDate   │
                    └──────┬──────┘
                           │ 1
                           ▼ *
┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│ DimCustomer  │1 ──►│  FactSales   │◄── 1│  DimProduct  │
└──────────────┘     └──────┬───────┘     └──────────────┘
                            │ *
                            ▼ 1
                     ┌─────────────┐
                     │ DimLocation │
                     └─────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I would use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Star schema&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1-to-many relationships&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unique dimension keys&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repeating foreign keys in fact tables&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single-direction filtering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clearly defined fact grain&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measures for business calculations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inactive relationships only where necessary&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  15. Why Star Schema Wins for Most Power BI Projects
&lt;/h1&gt;

&lt;p&gt;A star schema provides the best balance between simplicity and analytical power.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;The model avoids unnecessary duplication and provides straightforward relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  DAX
&lt;/h3&gt;

&lt;p&gt;Measures are easier to write because dimensions provide filtering context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Readability
&lt;/h3&gt;

&lt;p&gt;Developers can immediately identify facts and dimensions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability
&lt;/h3&gt;

&lt;p&gt;New dimensions and business processes can be added without redesigning everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maintainability
&lt;/h3&gt;

&lt;p&gt;The model has clear responsibilities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FACTS       → Business events
DIMENSIONS  → Descriptive context
RELATIONSHIPS → Filter propagation
MEASURES    → Business calculations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A snowflake schema still has its place, particularly for highly complex dimensions. A flat table can also be perfectly reasonable for small datasets.&lt;/p&gt;

&lt;p&gt;But when building a serious Power BI analytical solution, &lt;strong&gt;star schema should usually be your first choice&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final Takeaway
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ux5ua9rt68hwiniqscr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ux5ua9rt68hwiniqscr.png" alt="POWER BI REPORT SUMMARY" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Power BI modelling isn't simply about connecting tables until the visualisations work.&lt;/p&gt;

&lt;p&gt;It's about designing a structure that represents how the business thinks about its data.&lt;/p&gt;

&lt;p&gt;Remember these five rules:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Define the grain of your fact table.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Keep measurable events in fact tables.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Keep descriptive attributes in dimensions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Prefer 1-to-many, single-direction relationships.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Use Power Query merges when you need to combine data, and relationships when you need to connect data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you get the model right, everything built on top of it becomes easier—&lt;strong&gt;DAX, dashboards, filtering, performance and future development&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that's the real power of Power BI:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A great dashboard starts with a great data model.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>analytics</category>
      <category>datascience</category>
      <category>ai</category>
      <category>database</category>
    </item>
    <item>
      <title>Getting Started with Excel for Data Analytics: From Basics to Data Cleaning</title>
      <dc:creator>Ayam Abuga</dc:creator>
      <pubDate>Sat, 29 Aug 2026 23:10:19 +0000</pubDate>
      <link>https://dev.to/ayam_abuga_93093d63764982/getting-started-with-excel-for-data-analytics-from-basics-to-data-cleaning-328g</link>
      <guid>https://dev.to/ayam_abuga_93093d63764982/getting-started-with-excel-for-data-analytics-from-basics-to-data-cleaning-328g</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Data analytics&lt;/strong&gt; does not always begin with complicated programming or advanced statistical tools. For beginners, it can start with something as familiar as Microsoft Excel.&lt;/p&gt;

&lt;p&gt;During Week 1 of my data analytics learning, I focused on the fundamentals of preparing data for analysis. These included formatting, sorting, filtering, identifying missing values, removing duplicates, correcting inconsistent data and validating information.&lt;/p&gt;

&lt;p&gt;To apply these concepts practically, I worked with an HR dataset containing employee information such as Employee ID, names, departments, salaries, hire dates, ages, performance scores, employee types, office locations and other employee-related information.&lt;/p&gt;

&lt;p&gt;The dataset contained &lt;strong&gt;877 records and 21 columns&lt;/strong&gt;. Although it looked like a normal spreadsheet at first, closer inspection revealed several data-quality problems. This made it a useful dataset for practicing the data-cleaning techniques covered during Week 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspecting the Raw Dataset
&lt;/h2&gt;

&lt;p&gt;The first step in cleaning data is to understand what you have before changing anything.&lt;/p&gt;

&lt;p&gt;I opened the HR dataset in Excel and reviewed the columns and records. Some of the main fields included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Employee ID&lt;/li&gt;
&lt;li&gt;First Name&lt;/li&gt;
&lt;li&gt;Last Name&lt;/li&gt;
&lt;li&gt;Department&lt;/li&gt;
&lt;li&gt;Salary&lt;/li&gt;
&lt;li&gt;Hire Date&lt;/li&gt;
&lt;li&gt;Age&lt;/li&gt;
&lt;li&gt;Gender&lt;/li&gt;
&lt;li&gt;Performance Score&lt;/li&gt;
&lt;li&gt;Employee Type&lt;/li&gt;
&lt;li&gt;Office Location&lt;/li&gt;
&lt;li&gt;Project Count&lt;/li&gt;
&lt;li&gt;Remote Work Status&lt;/li&gt;
&lt;li&gt;Annual Training Hours&lt;/li&gt;
&lt;li&gt;Manager Feedback Score&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each row represented an employee, while each column represented a specific attribute.&lt;/p&gt;

&lt;h3&gt;
  
  
  Raw Dataset
&lt;/h3&gt;

&lt;p&gt;Before cleaning, the dataset was as follows;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkt2waw3wyruz86w1eg8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkt2waw3wyruz86w1eg8w.png" alt="Uncleaned dataset" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The initial inspection revealed missing values, duplicate employee IDs, inconsistent spelling, invalid dates and incorrect data types.&lt;/p&gt;

&lt;p&gt;This showed me why inspecting data before analysis is important. Data can look organized while still containing errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Formatting the Data
&lt;/h2&gt;

&lt;p&gt;After inspecting the dataset, I formatted the worksheet to make it easier to work with.&lt;br&gt;
I confirmed that the data contained headers.&lt;br&gt;
Using a table made it easier to work with the 877 records because Excel automatically provided filtering options for each column, as seen below;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft9403omr15hgx1t0k0ec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft9403omr15hgx1t0k0ec.png" alt="Table with filtering options" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also adjusted column widths and made sure that the headings and values were easy to read. This is done by selecting the whole dataset, and autofitting the column width, i.e;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F09c81dhi2ngi65f7ssru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F09c81dhi2ngi65f7ssru.png" alt="Adjusting the column widths" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Formatting&lt;/em&gt;&lt;/strong&gt; may not change the actual data, but it improves readability and makes the cleaning process much easier.&lt;/p&gt;

&lt;p&gt;For example, salary values can be displayed consistently with commas and in same format, as numbers and not texts, while dates can be displayed using one standard format,i.e;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4j6ehpk12czuh25x1e2z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4j6ehpk12czuh25x1e2z.png" alt="Alignment of salary and date values" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Identifying and Removing Duplicates
&lt;/h2&gt;

&lt;p&gt;Duplicate records were another important issue in the dataset.&lt;/p&gt;

&lt;p&gt;Employee ID is particularly useful when checking for duplicates because it is intended to identify an employee.&lt;/p&gt;

&lt;p&gt;I found employee IDs that appeared more than once in the dataset.&lt;/p&gt;

&lt;p&gt;If the same employee record is accidentally entered twice, keeping both records could produce incorrect results. For example, the number of employees could be overstated.&lt;/p&gt;

&lt;p&gt;Excel provides a &lt;strong&gt;Remove Duplicates&lt;/strong&gt; feature under the &lt;strong&gt;Data&lt;/strong&gt; tab.&lt;br&gt;
The process is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select the dataset.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Data&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Remove Duplicates&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the column used to identify duplicates.&lt;/li&gt;
&lt;li&gt;Review the records.&lt;/li&gt;
&lt;li&gt;Remove confirmed duplicates.
This is illustrated below;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcc3mew79ltc6o7k169cx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcc3mew79ltc6o7k169cx.png" alt="Removing duplicates" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, duplicate removal should be done carefully.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A repeated ID does not automatically prove that the entire record is incorrect.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The records should first be compared to determine whether they are genuine duplicates.&lt;/p&gt;

&lt;p&gt;This taught me an important lesson: &lt;strong&gt;data should be investigated before it is deleted.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Correcting Inconsistent Data
&lt;/h2&gt;

&lt;p&gt;Another problem I discovered was inconsistent text.&lt;/p&gt;

&lt;p&gt;For example, the Department column contained variations such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Marketing
Markting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There were also different versions of the IT department:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IT
I.T
Info Tech
Information Tech
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Office Location column had similar problems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;London
Londn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;San Francisco
San Fransisco
SF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Inconsistent Values
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3usuux6om0k1lkmi68fc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3usuux6om0k1lkmi68fc.png" alt="Inconsistent values" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These differences can cause problems when sorting, filtering or eventually grouping the data.&lt;/p&gt;

&lt;p&gt;For example, Excel would treat &lt;code&gt;London&lt;/code&gt; and &lt;code&gt;Londn&lt;/code&gt; as different values even though they may represent the same location.&lt;/p&gt;

&lt;p&gt;Some formatting inconsistencies can be handled with Excel functions such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=TRIM(A2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which removes unnecessary spaces.&lt;/p&gt;

&lt;p&gt;Capitalization can also be standardized using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=PROPER(A2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, spelling mistakes such as &lt;code&gt;Londn&lt;/code&gt; or &lt;code&gt;Markting&lt;/code&gt; need to be corrected systemically based on the expected value.&lt;/p&gt;

&lt;p&gt;This showed me that data cleaning is not simply about formatting. It also requires understanding what the values are supposed to represent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validating the Data
&lt;/h2&gt;

&lt;p&gt;After cleaning obvious problems, the next step was validation.&lt;/p&gt;

&lt;p&gt;Validation means checking whether the values make sense for their particular columns.&lt;/p&gt;

&lt;p&gt;For example, the Age column should contain reasonable numerical values.&lt;/p&gt;

&lt;p&gt;However, the dataset contained a value such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;thirty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;while most other ages were numerical.&lt;/p&gt;

&lt;p&gt;This value needs to be investigated because it does not follow the expected format.&lt;/p&gt;

&lt;p&gt;The Hire Date column also contained invalid dates, including:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2019-02-30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;February does not have 30 days, so this cannot be a valid calendar date.&lt;/p&gt;

&lt;p&gt;The Performance Score column also contained unusual values, including text and values outside the expected range.&lt;/p&gt;

&lt;p&gt;These examples demonstrated that validation requires more than checking whether a cell contains data.&lt;br&gt;
Validation is usually done before data is entered, to standardize the texts entered in the dataset, i.e,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbcg19xi9759d227vcvz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbcg19xi9759d227vcvz9.png" alt="Data Validation" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The question should be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does this value make sense for this particular field?&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Basic Sorting
&lt;/h2&gt;

&lt;p&gt;Sorting was another technique I used when working with the dataset.&lt;/p&gt;

&lt;p&gt;Excel allows data to be arranged from smallest to largest, largest to smallest or alphabetically.&lt;/p&gt;

&lt;p&gt;For example, I could sort the Salary column from largest to smallest to identify the highest salaries.&lt;/p&gt;

&lt;p&gt;I could also sort Employee IDs to make repeated IDs easier to identify.&lt;/p&gt;

&lt;p&gt;Sorting the Department or Office Location columns can also make spelling inconsistencies easier to notice because similar values appear together.&lt;/p&gt;

&lt;p&gt;Sorting therefore serves both an organizational and data-cleaning purpose.&lt;/p&gt;
&lt;h2&gt;
  
  
  Basic Filtering
&lt;/h2&gt;

&lt;p&gt;Filtering allows me to temporarily display only the records I need.&lt;/p&gt;

&lt;p&gt;For example, I could filter the Department column to show only employees working in HR.&lt;/p&gt;

&lt;p&gt;I could also filter the Age column or Salary column to investigate specific ranges.&lt;/p&gt;

&lt;p&gt;Most importantly for data cleaning, I could filter for blank values to quickly find missing information.&lt;/p&gt;

&lt;p&gt;With 877 records, this is much faster than manually checking every row.&lt;/p&gt;

&lt;p&gt;Sorting and filtering are simple Excel features, but they are extremely useful when working with real datasets.&lt;/p&gt;
&lt;h2&gt;
  
  
  My Data-Cleaning Workflow
&lt;/h2&gt;

&lt;p&gt;After working with the dataset, I developed a simple workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw Dataset
     ↓
Inspect
     ↓
Format
     ↓
Find Missing Values
     ↓
Identify Duplicates
     ↓
Remove Confirmed Duplicates
     ↓
Correct Inconsistent Values
     ↓
Validate Data
     ↓
Sort and Filter
     ↓
Clean Dataset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final cleaned file looked as below;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw94won9cpyda7pbt9xng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw94won9cpyda7pbt9xng.png" alt="Clean dataset" width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
The purpose of this process is to make the dataset more consistent and reliable before using it for further analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Working with the HR dataset helped me understand that data cleaning is an essential part of data analytics.&lt;/p&gt;

&lt;p&gt;The dataset contained problems that would have been easy to overlook without careful inspection. These included missing values, duplicate Employee IDs, inconsistent department names, misspelled locations, invalid dates and incorrect data types.&lt;/p&gt;

&lt;p&gt;The Excel tools I learned during Week 1 provided practical ways to deal with these problems.&lt;/p&gt;

&lt;p&gt;Formatting made the dataset easier to read. Filtering helped locate missing values. Sorting helped identify patterns and inconsistencies. Remove Duplicates helped eliminate confirmed duplicate records. Validation helped determine whether values were reasonable and correctly formatted.&lt;/p&gt;

&lt;p&gt;Most importantly, I learned that cleaning data requires judgment. An unusual value should not immediately be deleted. It should first be investigated and understood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Excel provides a simple but powerful starting point for learning data analytics.&lt;/p&gt;

&lt;p&gt;Working with the HR dataset allowed me to apply the Week 1 concepts to a realistic data-cleaning problem rather than simply learning them theoretically.&lt;/p&gt;

&lt;p&gt;The process can be summarized as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Inspect → Format → Clean → Validate → Sort/Filter → Prepare&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest lesson I took from this exercise is that analysis should not begin with assumptions about the data. It should begin by understanding and checking the data.&lt;/p&gt;

&lt;p&gt;A clean dataset produces more reliable results, while dirty or inconsistent data can lead to misleading conclusions.&lt;/p&gt;

&lt;p&gt;As I continue learning data analytics, these basic Excel skills will provide a foundation for working with larger datasets and more advanced tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Before analyzing data, make sure the data is clean. Before trusting the data, validate it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>beginners</category>
      <category>datascience</category>
      <category>analytics</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
