<?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: Gloria Adhiambo Awinja</title>
    <description>The latest articles on DEV Community by Gloria Adhiambo Awinja (@gloriaawinja).</description>
    <link>https://dev.to/gloriaawinja</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%2F4070923%2F6a18131d-b1ce-45df-be86-662e4f2df1ae.png</url>
      <title>DEV Community: Gloria Adhiambo Awinja</title>
      <link>https://dev.to/gloriaawinja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gloriaawinja"/>
    <language>en</language>
    <item>
      <title>JCars Logistics Analysis: Data Preparation, Modelling, and Business Insights</title>
      <dc:creator>Gloria Adhiambo Awinja</dc:creator>
      <pubDate>Mon, 28 Sep 2026 11:25:59 +0000</pubDate>
      <link>https://dev.to/gloriaawinja/jcars-logistics-analysis-data-preparation-modelling-and-business-insights-jp4</link>
      <guid>https://dev.to/gloriaawinja/jcars-logistics-analysis-data-preparation-modelling-and-business-insights-jp4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;A Power BI dashboard is only as reliable as the data behind it.&lt;br&gt;
For the JCars Logistics project, the starting point was not a clean analytical dataset. It was a single raw transactional export containing sales, customer, vehicle, branch, payment, delivery, logistics and customer-experience information. The dataset had 276 order lines and 32 columns, but it also contained inconsistent categories, mixed currencies, missing values, different date formats, numbers recorded as words, suspicious business values and an unreliable recorded revenue field.&lt;/p&gt;

&lt;p&gt;The objective was therefore not simply to build a visually attractive dashboard. The real task was to take the raw export through a complete analytical process:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Raw data → Investigation → Cleaning → Validation → Modelling → DAX → Dashboard → Analysis → Insights → Recommendations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article explains that journey, including the reasoning behind the major decisions made along the way.&lt;/p&gt;
&lt;h1&gt;
  
  
  1. Understanding the Raw Dataset
&lt;/h1&gt;

&lt;p&gt;The project began with &lt;code&gt;Jcars_data.csv&lt;/code&gt;, a flat file containing 32 columns.&lt;/p&gt;

&lt;p&gt;Each row represented one vehicle sales order line: an order for one or more units of a particular vehicle configuration, sold by a sales representative to a customer through a branch.&lt;/p&gt;

&lt;p&gt;The dataset covered areas including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customers&lt;/li&gt;
&lt;li&gt;Locations and branches&lt;/li&gt;
&lt;li&gt;Sales representatives&lt;/li&gt;
&lt;li&gt;Lead sources&lt;/li&gt;
&lt;li&gt;Vehicles&lt;/li&gt;
&lt;li&gt;Prices and costs&lt;/li&gt;
&lt;li&gt;Discounts&lt;/li&gt;
&lt;li&gt;Payments&lt;/li&gt;
&lt;li&gt;Deliveries&lt;/li&gt;
&lt;li&gt;Logistics&lt;/li&gt;
&lt;li&gt;Customer ratings&lt;/li&gt;
&lt;li&gt;Returns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There were &lt;strong&gt;276 order lines representing 466 units sold&lt;/strong&gt;, with Order Dates spanning &lt;strong&gt;1 January 2025 to 1 December 2026&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first glance, this looked like a straightforward sales dataset. However, the first important decision was not to immediately start building visuals.&lt;/p&gt;

&lt;p&gt;The dataset needed to be investigated first.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why investigation came first
&lt;/h3&gt;

&lt;p&gt;Building charts before understanding the underlying data can create a polished dashboard containing incorrect information.&lt;/p&gt;

&lt;p&gt;For example, if &lt;code&gt;Toyota&lt;/code&gt;, &lt;code&gt;totoya&lt;/code&gt; and &lt;code&gt;toyta&lt;/code&gt; are treated as three separate vehicle makes, the resulting Toyota sales figure would be understated.&lt;br&gt;
Similarly, combining USD, EUR, ZAR and KES values without conversion would make revenue and profitability calculations meaningless.&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%2F0pe1k4kgbxy3a7vn7uiq.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%2F0pe1k4kgbxy3a7vn7uiq.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first stage therefore focused on finding out &lt;strong&gt;what was actually wrong with the raw data&lt;/strong&gt;.&lt;/p&gt;
&lt;h1&gt;
  
  
  2. Data Quality Investigation
&lt;/h1&gt;

&lt;p&gt;The investigation revealed that almost every part of the dataset had its own potential data-quality issue.&lt;/p&gt;

&lt;p&gt;Some problems were simple formatting inconsistencies, while others could directly affect business calculations.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Misspelled categories such as &lt;code&gt;totoya&lt;/code&gt; and &lt;code&gt;toyta&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Variations such as &lt;code&gt;Mercedes Benz&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Location variations such as &lt;code&gt;cental&lt;/code&gt; and &lt;code&gt;nrb&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Model variations such as &lt;code&gt;harier&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Multiple currencies including KES, KSh, USD, EUR, ZAR and R&lt;/li&gt;
&lt;li&gt;Monetary values using &lt;code&gt;M&lt;/code&gt; to represent millions&lt;/li&gt;
&lt;li&gt;Missing-value placeholders such as &lt;code&gt;N/A&lt;/code&gt;, &lt;code&gt;NULL&lt;/code&gt;, &lt;code&gt;TBD&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt; and &lt;code&gt;#VALUE!&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Excel serial dates and inconsistent date formats&lt;/li&gt;
&lt;li&gt;Units recorded as words such as &lt;code&gt;one&lt;/code&gt;, &lt;code&gt;two&lt;/code&gt; and &lt;code&gt;three&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Discounts recorded in different formats&lt;/li&gt;
&lt;li&gt;Customer ratings recorded as &lt;code&gt;excellent&lt;/code&gt;, &lt;code&gt;4/5&lt;/code&gt; and &lt;code&gt;3 out of 5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review counts recorded partly as words&lt;/li&gt;
&lt;li&gt;Implausible customer ages&lt;/li&gt;
&lt;li&gt;Typing errors in sales representative names&lt;/li&gt;
&lt;li&gt;Zero logistics costs on delivered orders&lt;/li&gt;
&lt;li&gt;Zero recorded revenue on active orders&lt;/li&gt;
&lt;/ul&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%2Faqsqpnu0zntl36aytgdf.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%2Faqsqpnu0zntl36aytgdf.png" alt=" " width="799" height="448"&gt;&lt;/a&gt;&lt;br&gt;
The important distinction was that these were not all treated as the same type of problem.&lt;/p&gt;

&lt;p&gt;Instead, each issue was considered in terms of &lt;strong&gt;how it could affect the analysis&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, a misspelled category affects grouping and aggregation, while a mixed currency affects the numerical meaning of the value itself.&lt;/p&gt;

&lt;p&gt;This led to a more structured cleaning approach.&lt;/p&gt;
&lt;h1&gt;
  
  
  3. Cleaning the Data in Power Query
&lt;/h1&gt;

&lt;p&gt;Power Query was used as the main data preparation layer.&lt;/p&gt;

&lt;p&gt;Rather than manually correcting individual cells, reusable functions were created for different types of problems.&lt;/p&gt;

&lt;p&gt;This was an important design decision because the goal was to make the cleaning process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeatable&lt;/li&gt;
&lt;li&gt;Transparent&lt;/li&gt;
&lt;li&gt;Easier to audit&lt;/li&gt;
&lt;li&gt;Easier to maintain&lt;/li&gt;
&lt;li&gt;Capable of being rerun if the raw export changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main functions included:&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;fnCat&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This function handled categorical data.&lt;/p&gt;

&lt;p&gt;Instead of simply replacing one spelling at a time, the function used mapping tables to standardize known variations.&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;totoya&lt;/code&gt; → &lt;code&gt;Toyota&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;toyta&lt;/code&gt; → &lt;code&gt;Toyota&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This ensured that different spellings of the same business category would be treated as one category in the analysis.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;fnDate&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Dates required their own logic because the dataset contained different date formats as well as Excel serial dates.&lt;/p&gt;

&lt;p&gt;The function converted these values into a consistent date format so that transactions could be analysed correctly by year, quarter and month.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;fnMoneyKES&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Money required more complex treatment.&lt;/p&gt;

&lt;p&gt;The function:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identified the currency marker.&lt;/li&gt;
&lt;li&gt;Removed formatting characters.&lt;/li&gt;
&lt;li&gt;Detected the &lt;code&gt;M&lt;/code&gt; shorthand.&lt;/li&gt;
&lt;li&gt;Applied the appropriate currency conversion.&lt;/li&gt;
&lt;li&gt;Returned null for invalid or placeholder values.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This meant that monetary fields could eventually be compared and aggregated using one common currency.&lt;/p&gt;
&lt;h3&gt;
  
  
  Other functions
&lt;/h3&gt;

&lt;p&gt;Additional functions were created for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order IDs&lt;/li&gt;
&lt;li&gt;Customer Age&lt;/li&gt;
&lt;li&gt;Vehicle Year&lt;/li&gt;
&lt;li&gt;Units Sold&lt;/li&gt;
&lt;li&gt;Discount&lt;/li&gt;
&lt;li&gt;Customer Rating&lt;/li&gt;
&lt;li&gt;Review Count&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result was a cleaning process based on the &lt;strong&gt;type of data problem&lt;/strong&gt;, rather than a long sequence of manual corrections.&lt;/p&gt;
&lt;h1&gt;
  
  
  4. Standardizing Currency
&lt;/h1&gt;

&lt;p&gt;One of the most important cleaning decisions involved currency.&lt;/p&gt;

&lt;p&gt;The dataset contained monetary values in different currencies, including:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Currency&lt;/th&gt;
&lt;th&gt;Rate to KES&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;KES / KSh&lt;/td&gt;
&lt;td&gt;No conversion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USD&lt;/td&gt;
&lt;td&gt;129.54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EUR&lt;/td&gt;
&lt;td&gt;147.84&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZAR&lt;/td&gt;
&lt;td&gt;7.93&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Values without an explicit currency marker were assumed to be KES.&lt;/p&gt;

&lt;p&gt;This was necessary because revenue, selling price, unit cost and logistics cost eventually needed to be combined in profitability calculations.&lt;/p&gt;

&lt;p&gt;The conversion was applied consistently throughout the project rather than using transaction-specific exchange rates.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;M&lt;/code&gt; shorthand was also handled. For example, a value such as &lt;code&gt;5M&lt;/code&gt; needed to be interpreted as 5,000,000 rather than simply 5.&lt;/p&gt;

&lt;p&gt;The order of these operations mattered as well. Currency conversion was performed before downstream calculations so that all monetary values were on a common KES basis.&lt;/p&gt;
&lt;h1&gt;
  
  
  5. Dealing With Missing and Suspicious Data
&lt;/h1&gt;

&lt;p&gt;Not every unusual value was simply deleted.&lt;/p&gt;

&lt;p&gt;This was an important principle throughout the project.&lt;/p&gt;

&lt;p&gt;For example, a logistics cost of zero on a delivered order may be technically valid in some circumstances, but from a business perspective it is suspicious enough to investigate.&lt;/p&gt;

&lt;p&gt;Similarly, a recorded revenue of zero on an order that was not cancelled or refunded could distort revenue analysis.&lt;/p&gt;

&lt;p&gt;These values were therefore flagged rather than silently accepted.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;Data Quality Flag&lt;/code&gt; was also introduced to identify records affected by issues such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing order dates&lt;/li&gt;
&lt;li&gt;Missing delivery dates&lt;/li&gt;
&lt;li&gt;Estimated selling prices&lt;/li&gt;
&lt;li&gt;Estimated unit costs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where missing values had to be filled so that calculations could continue, documented defaults were used.&lt;/p&gt;

&lt;p&gt;However, the original data-quality issue was still retained through the flag.&lt;/p&gt;

&lt;p&gt;This approach avoided a common problem in data cleaning: making the final dataset look complete while hiding how much of it had been estimated or corrected.&lt;/p&gt;
&lt;h1&gt;
  
  
  6. Rebuilding Revenue Instead of Trusting the Raw Field
&lt;/h1&gt;

&lt;p&gt;One of the most important findings during the investigation was that the recorded revenue field could not simply be taken at face value.&lt;/p&gt;

&lt;p&gt;Instead, revenue was independently rebuilt using:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Revenue = Units Sold × Unit Selling Price × (1 − Discount) + Delivery Fee&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This created a calculated Revenue field that could be compared against the original &lt;code&gt;Revenue Recorded&lt;/code&gt; value.&lt;/p&gt;

&lt;p&gt;The reason for doing this was straightforward: if the raw revenue field contained errors, using it directly would carry those errors into every KPI, chart and profitability calculation.&lt;/p&gt;

&lt;p&gt;The rebuilt revenue therefore became the basis for the analysis.&lt;/p&gt;

&lt;p&gt;This was one of the key lessons from the project:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A financial field in a raw export should be validated against the underlying transaction logic before being used as a core KPI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
  
  
  7. Data Validation Before Modelling
&lt;/h1&gt;

&lt;p&gt;Cleaning was followed by validation.&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%2Fby2gw0dwbtvqfjlkopa8.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%2Fby2gw0dwbtvqfjlkopa8.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The purpose was to confirm that the cleaned dataset was actually ready for modelling.&lt;/p&gt;

&lt;p&gt;Several checks were performed.&lt;/p&gt;
&lt;h3&gt;
  
  
  Type validation
&lt;/h3&gt;

&lt;p&gt;Dates were converted to date types and monetary fields to numeric/currency types.&lt;/p&gt;

&lt;p&gt;This prevented numbers from silently remaining as text.&lt;/p&gt;
&lt;h3&gt;
  
  
  Row-count validation
&lt;/h3&gt;

&lt;p&gt;The cleaned dataset was checked against the original dataset.&lt;/p&gt;

&lt;p&gt;The row count remained at &lt;strong&gt;276&lt;/strong&gt;, confirming that records had not been unintentionally dropped during cleaning.&lt;/p&gt;
&lt;h3&gt;
  
  
  Business-rule validation
&lt;/h3&gt;

&lt;p&gt;Business rules were used to identify suspicious values.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Logistics Cost = 0 on Delivered orders&lt;/li&gt;
&lt;li&gt;Revenue Recorded = 0 on non-Cancelled/non-Refunded orders&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Revenue validation
&lt;/h3&gt;

&lt;p&gt;The rebuilt revenue calculation was compared with the recorded revenue.&lt;/p&gt;
&lt;h3&gt;
  
  
  Category coverage
&lt;/h3&gt;

&lt;p&gt;Mapping tables were built from the distinct values found in the source data so that known variations were accounted for.&lt;/p&gt;

&lt;p&gt;Only after these checks was the data considered ready for modelling.&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%2Fcvjxu228r1f8kfofhr6t.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%2Fcvjxu228r1f8kfofhr6t.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  8. Moving From a Flat File to a Star Schema
&lt;/h1&gt;

&lt;p&gt;The cleaned data was initially still a flat transactional table.&lt;/p&gt;

&lt;p&gt;That structure was not ideal for the final Power BI model because it mixed transaction-level measures with descriptive information such as customer, vehicle and sales representative attributes.&lt;/p&gt;

&lt;p&gt;The next step was therefore to restructure the data into a star schema.&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%2Fxtx5ztf3zmre2328uoo6.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%2Fxtx5ztf3zmre2328uoo6.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
The central table became:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FACT TABLE 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It retained the transaction-level information, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dates&lt;/li&gt;
&lt;li&gt;Units&lt;/li&gt;
&lt;li&gt;Prices&lt;/li&gt;
&lt;li&gt;Costs&lt;/li&gt;
&lt;li&gt;Discounts&lt;/li&gt;
&lt;li&gt;Fees&lt;/li&gt;
&lt;li&gt;Payment information&lt;/li&gt;
&lt;li&gt;Delivery information&lt;/li&gt;
&lt;li&gt;Revenue&lt;/li&gt;
&lt;li&gt;Cost of Goods Sold&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dimension tables were created around it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DIM-CUSTOMER&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DIM-VEHICLE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DIM-SALES REP&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DIM-LEAD SOURCE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each dimension was created using distinct combinations of its relevant attributes and given a surrogate index key.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why use dimensions?
&lt;/h3&gt;

&lt;p&gt;The purpose was to separate descriptive information from transactional data.&lt;/p&gt;

&lt;p&gt;For example, vehicle information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make&lt;/li&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;Vehicle Type&lt;/li&gt;
&lt;li&gt;Vehicle Year&lt;/li&gt;
&lt;li&gt;Fuel Type&lt;/li&gt;
&lt;li&gt;Transmission&lt;/li&gt;
&lt;li&gt;Colour&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;belongs naturally in a vehicle dimension rather than being repeatedly stored as descriptive information in the fact table.&lt;/p&gt;

&lt;p&gt;The result was a model that was easier to filter, analyse and extend.&lt;/p&gt;
&lt;h1&gt;
  
  
  9. Building the Relationships
&lt;/h1&gt;

&lt;p&gt;The fact table was connected to the dimension tables using the surrogate keys.&lt;/p&gt;

&lt;p&gt;The relationships were configured as many-to-one relationships from the fact table to the dimensions.&lt;/p&gt;

&lt;p&gt;Bidirectional filtering was enabled so that slicers and interactions could work across the report as intended.&lt;/p&gt;

&lt;p&gt;This modelling stage was particularly important because the dashboard was designed to support interactive analysis rather than static charts.&lt;/p&gt;

&lt;p&gt;A user should be able to select a vehicle type and see the rest of the report respond accordingly.&lt;/p&gt;
&lt;h1&gt;
  
  
  10. Developing the DAX Layer
&lt;/h1&gt;

&lt;p&gt;Once the model was established, DAX was used to create the core business metrics.&lt;/p&gt;

&lt;p&gt;The first measure was Total Revenue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total revenue =
SUM('FACT TABLE 2'[Revenue])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Total Units Sold was then used as the main volume 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 Units Sold =
SUM('Jcars_data-CLEANED'[Units Sold])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To analyse profitability, Cost of Goods Sold was calculated at the transaction level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cost of goods Sold =
'FACT TABLE 2'[Unit Cost] *
'FACT TABLE 2'[Units Sold]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gross Profit was then calculated as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Gross Profit =
[Total revenue] -
SUM('FACT TABLE 2'[Cost of goods Sold])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, Gross Profit Margin was calculated as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Gross Profit Margin =
([Total Gross Profit] / [Total revenue]) * 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These calculations established the core financial logic of the dashboard.&lt;/p&gt;

&lt;p&gt;The business definitions were kept straightforward:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Revenue = Units × Price × (1 − Discount) + Delivery Fee&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gross Profit = Revenue − Cost of Goods Sold&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gross Profit Margin = Gross Profit ÷ Revenue&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Designing the Executive Dashboard
&lt;/h1&gt;

&lt;p&gt;With the data and calculations in place, the next challenge was deciding what management should see first.&lt;/p&gt;

&lt;p&gt;The Executive Dashboard was designed as a high-level overview rather than an attempt to display every available field.&lt;/p&gt;

&lt;p&gt;The first layer consisted of four KPI cards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total Units Sold&lt;/li&gt;
&lt;li&gt;Total Revenue&lt;/li&gt;
&lt;li&gt;Total Gross Profit&lt;/li&gt;
&lt;li&gt;Total Gross Profit Margin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These were chosen because together they provide a quick view of:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;volume → revenue → profit → profitability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The remaining visuals were selected to answer the natural follow-up questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where is profit being generated?&lt;/li&gt;
&lt;li&gt;Which vehicle makes perform best?&lt;/li&gt;
&lt;li&gt;Which branches contribute the most?&lt;/li&gt;
&lt;li&gt;Which lead sources generate profit?&lt;/li&gt;
&lt;li&gt;How are sales distributed across representatives?&lt;/li&gt;
&lt;li&gt;What is happening over time?&lt;/li&gt;
&lt;li&gt;What delivery statuses are associated with sales?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Executive Dashboard screenshot
&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%2Fvrglasfy2xtozl77bcuq.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%2Fvrglasfy2xtozl77bcuq.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JCars Executive Dashboard showing the main KPI cards and supporting sales, profitability, branch, lead-source and delivery visuals.&lt;/p&gt;

&lt;p&gt;The purpose of this page was not to show every possible analysis. It was to give management a starting point from which deeper questions could be identified.&lt;/p&gt;

&lt;h1&gt;
  
  
  13. Adding Interactivity With the Drill Through Page.
&lt;/h1&gt;

&lt;p&gt;The report was designed to allow users to move from summary information into more specific questions.&lt;/p&gt;

&lt;p&gt;A Vehicle Type slicer was used across the report so that selecting a vehicle category would update the relevant visuals.&lt;/p&gt;

&lt;p&gt;Cross-filtering was also enabled between visuals.&lt;/p&gt;

&lt;p&gt;Drill-through functionality was incorporated for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;City&lt;/li&gt;
&lt;li&gt;County&lt;/li&gt;
&lt;li&gt;Fuel Type&lt;/li&gt;
&lt;li&gt;Returned Status&lt;/li&gt;
&lt;/ul&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%2Fi13tklxu74k5w3cccxxy.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%2Fi13tklxu74k5w3cccxxy.png" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This meant that the report could be used as an investigation tool rather than simply as a presentation of fixed numbers.&lt;/p&gt;

&lt;p&gt;For example, if a user noticed an unusual return pattern, they could move from the summary level into more detailed information rather than manually searching through the original dataset.&lt;/p&gt;

&lt;h1&gt;
  
  
  14. The First Major Finding: Profitability Was Highly Concentrated
&lt;/h1&gt;

&lt;p&gt;Once the dashboard was interactive, the analysis moved beyond simply describing totals.&lt;/p&gt;

&lt;p&gt;One of the clearest patterns was the concentration of Gross Profit.&lt;/p&gt;

&lt;p&gt;Toyota and Volkswagen together generated approximately &lt;strong&gt;69% of total Gross Profit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the branch level, Thika and Nairobi HQ together generated approximately &lt;strong&gt;65% of total Gross Profit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This changed the question from:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Which brands and branches sell the most?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How dependent is overall profitability on a small number of brands and locations?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The concentration matters because a problem affecting one of these major contributors could have a much larger financial effect than an issue affecting a smaller contributor.&lt;/p&gt;

&lt;p&gt;This became one of the main business-risk observations from the analysis.&lt;/p&gt;

&lt;h1&gt;
  
  
  15. The Second Finding: Volume and Profit Were Not the Same Thing
&lt;/h1&gt;

&lt;p&gt;SUVs were the leading vehicle type by volume, accounting for &lt;strong&gt;178 of the 466 units sold&lt;/strong&gt;, or approximately &lt;strong&gt;38%&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;However, the analysis showed that volume leadership and profit concentration were not necessarily the same thing.&lt;/p&gt;

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

&lt;p&gt;A vehicle category can sell many units without generating the highest amount of profit.&lt;/p&gt;

&lt;p&gt;Therefore, inventory decisions based on units sold should not automatically be treated as profitability decisions.&lt;/p&gt;

&lt;p&gt;The dashboard made it possible to examine both measures separately.&lt;/p&gt;

&lt;h1&gt;
  
  
  16. Investigating Lead Sources
&lt;/h1&gt;

&lt;p&gt;The analysis also looked at profitability by lead source.&lt;/p&gt;

&lt;p&gt;This revealed an unusual result:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WhatsApp-sourced orders produced an aggregate Gross Profit of approximately −KES 3.49 million.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It was the only lead source in negative territory.&lt;/p&gt;

&lt;p&gt;By comparison, Walk-in and Website each contributed more than &lt;strong&gt;KES 140 million&lt;/strong&gt; in Gross Profit.&lt;/p&gt;

&lt;p&gt;This raised a business question rather than providing an immediate explanation.&lt;/p&gt;

&lt;p&gt;Several possibilities needed to be considered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lower-margin deals may be coming through WhatsApp.&lt;/li&gt;
&lt;li&gt;Discounts may be higher for that channel.&lt;/li&gt;
&lt;li&gt;A small number of unusual transactions may be distorting the total.&lt;/li&gt;
&lt;li&gt;There could be a data-recording issue affecting WhatsApp orders.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For that reason, the appropriate next step is investigation rather than assuming the channel itself is necessarily the problem.&lt;/p&gt;

&lt;h1&gt;
  
  
  17. Investigating Returns
&lt;/h1&gt;

&lt;p&gt;Another notable finding was the number of records marked:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Returned = Yes: 88 orders, or 31.9%.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a large enough proportion to deserve further investigation.&lt;/p&gt;

&lt;p&gt;However, the dataset alone does not establish why those returns occurred.&lt;/p&gt;

&lt;p&gt;The analysis therefore did not treat the return percentage as proof of a vehicle-quality or fulfilment problem.&lt;/p&gt;

&lt;p&gt;Instead, the recommended next step was to segment the returned population by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make&lt;/li&gt;
&lt;li&gt;Model&lt;/li&gt;
&lt;li&gt;Branch&lt;/li&gt;
&lt;li&gt;Sales Representative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and compare it against delivery status and individual vehicle records.&lt;/p&gt;

&lt;p&gt;This would help determine whether returns are concentrated in particular areas or simply reflect how the field was recorded.&lt;/p&gt;

&lt;h1&gt;
  
  
  18. Investigating the Late-2026 Drop
&lt;/h1&gt;

&lt;p&gt;The quarterly analysis revealed another unusual pattern.&lt;/p&gt;

&lt;p&gt;Order volume fell sharply after Q2 2026.&lt;/p&gt;

&lt;p&gt;The dataset contained:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only 1 order in Q3 2026&lt;/li&gt;
&lt;li&gt;3 orders in Q4 2026&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;compared with approximately 34–84 orders per quarter through mid-2026.&lt;/p&gt;

&lt;p&gt;At first glance, this could look like a major decline in business.&lt;/p&gt;

&lt;p&gt;However, the analysis considered the data-collection context as well.&lt;/p&gt;

&lt;p&gt;The pattern could be explained by the export having been taken partway through the later quarters.&lt;/p&gt;

&lt;p&gt;Because the dataset itself could not prove which explanation was correct, the finding was treated as a &lt;strong&gt;data-completeness issue requiring confirmation&lt;/strong&gt;, rather than automatically reporting it as a genuine business slowdown.&lt;/p&gt;

&lt;p&gt;This is an important example of why data analysis requires context.&lt;/p&gt;

&lt;p&gt;A chart can show a pattern, but the analyst still needs to determine whether the pattern represents the business or the way the data was collected.&lt;/p&gt;

&lt;h1&gt;
  
  
  19. Data Quality Became an Analytical Finding
&lt;/h1&gt;

&lt;p&gt;Data quality was not treated purely as a technical cleaning issue.&lt;/p&gt;

&lt;p&gt;It became part of the final business interpretation.&lt;/p&gt;

&lt;p&gt;Out of the 276 order lines, &lt;strong&gt;76 rows, or 27.5%, carried at least one data-quality flag&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These flags were largely associated with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing dates&lt;/li&gt;
&lt;li&gt;Estimated selling prices&lt;/li&gt;
&lt;li&gt;Estimated costs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This meant that the dashboard could be used for analysis, but its results needed to be interpreted with the quality of the underlying records in mind.&lt;/p&gt;

&lt;p&gt;This is particularly important when looking at small subsets.&lt;/p&gt;

&lt;p&gt;For example, a percentage calculated for a single branch, sales representative or month could be heavily affected if only a few records make up that group and some of them contain estimated values.&lt;/p&gt;

&lt;h1&gt;
  
  
  20. Overall Financial Picture
&lt;/h1&gt;

&lt;p&gt;After cleaning, validation and calculation, the analysis-ready dataset produced the following headline figures:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Total Units Sold&lt;/td&gt;
&lt;td&gt;466&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total Revenue&lt;/td&gt;
&lt;td&gt;KES 1,897,538,016&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total Cost of Goods Sold&lt;/td&gt;
&lt;td&gt;KES 1,482,051,475&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total Gross Profit&lt;/td&gt;
&lt;td&gt;KES 415,486,541&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gross Profit Margin&lt;/td&gt;
&lt;td&gt;21.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orders Analysed&lt;/td&gt;
&lt;td&gt;276&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data-Quality Flagged Rows&lt;/td&gt;
&lt;td&gt;76 (27.5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Returned = Yes&lt;/td&gt;
&lt;td&gt;88 orders (31.9%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delivery Status = Cancelled&lt;/td&gt;
&lt;td&gt;37 orders (13.4%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment Status = Cancelled&lt;/td&gt;
&lt;td&gt;27 orders (9.8%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These numbers formed the foundation of the Executive Dashboard and the subsequent business investigation.&lt;/p&gt;

&lt;h1&gt;
  
  
  21. From Findings to Management Insights
&lt;/h1&gt;

&lt;p&gt;The purpose of the analysis was not simply to identify interesting charts.&lt;/p&gt;

&lt;p&gt;The findings were translated into questions management could actually act on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Profit concentration
&lt;/h3&gt;

&lt;p&gt;Toyota and Volkswagen account for approximately 69% of Gross Profit, while Thika and Nairobi HQ account for approximately 65%.&lt;/p&gt;

&lt;p&gt;This highlights concentration across both vehicle makes and branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lead-source performance
&lt;/h3&gt;

&lt;p&gt;Walk-in and Website generated more than KES 140 million each in Gross Profit, while WhatsApp was negative in aggregate.&lt;/p&gt;

&lt;p&gt;This creates a reason to investigate how deals from different channels are priced, discounted and recorded.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data quality
&lt;/h3&gt;

&lt;p&gt;More than a quarter of order lines carried a data-quality flag.&lt;/p&gt;

&lt;p&gt;This means that improving the quality of future exports could improve the reliability of management reporting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Returns
&lt;/h3&gt;

&lt;p&gt;The 31.9% returned rate deserves investigation by vehicle, location and sales representative before conclusions are drawn about the cause.&lt;/p&gt;

&lt;h3&gt;
  
  
  Volume versus profitability
&lt;/h3&gt;

&lt;p&gt;SUVs lead in units sold, but profitability is more concentrated at the car-make level.&lt;/p&gt;

&lt;p&gt;This demonstrates why operational decisions should use the appropriate metric rather than relying on volume alone.&lt;/p&gt;

&lt;h1&gt;
  
  
  22. Recommendations
&lt;/h1&gt;

&lt;p&gt;The recommendations were directly linked to the findings rather than being generic suggestions.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Investigate the WhatsApp lead-generation channel
&lt;/h2&gt;

&lt;p&gt;WhatsApp was the only lead source with negative aggregate Gross Profit.&lt;/p&gt;

&lt;p&gt;Before changing investment in the channel, the business should determine whether the result comes from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lower-margin transactions&lt;/li&gt;
&lt;li&gt;Higher discounts&lt;/li&gt;
&lt;li&gt;A small number of outliers&lt;/li&gt;
&lt;li&gt;A data-recording problem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The underlying transactions should be reviewed before deciding what action to take.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Review concentration in major vehicle makes and branches
&lt;/h2&gt;

&lt;p&gt;Because Toyota and Volkswagen generate approximately 69% of Gross Profit, and Thika and Nairobi HQ generate approximately 65%, management should understand the level of dependency on these contributors.&lt;/p&gt;

&lt;p&gt;This includes reviewing contingency plans around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vehicle supply&lt;/li&gt;
&lt;li&gt;Branch operations&lt;/li&gt;
&lt;li&gt;Staffing&lt;/li&gt;
&lt;li&gt;Operational disruptions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Investigate returned orders
&lt;/h2&gt;

&lt;p&gt;The 88 returned orders should be segmented by make, model, branch and sales representative.&lt;/p&gt;

&lt;p&gt;This would help determine whether the returns are concentrated in particular parts of the business.&lt;/p&gt;

&lt;p&gt;The definition of the &lt;code&gt;Returned&lt;/code&gt; field should also be reviewed to make sure it is being recorded consistently.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Confirm the late-2026 data completeness
&lt;/h2&gt;

&lt;p&gt;The sharp fall in Q3–Q4 2026 orders should be checked against the original export and data owner.&lt;/p&gt;

&lt;p&gt;It should not be used to describe a genuine business slowdown until it has been confirmed that the dataset covers those quarters completely.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Improve future data-quality controls
&lt;/h2&gt;

&lt;p&gt;The project identified recurring issues around categories, dates, prices, costs and business-rule inconsistencies.&lt;/p&gt;

&lt;p&gt;The reusable Power Query functions created during this project provide a starting point for applying the same controls automatically to future exports.&lt;/p&gt;

&lt;h1&gt;
  
  
  23. What the Project Demonstrated
&lt;/h1&gt;

&lt;p&gt;The most important lesson from the project was that the dashboard itself was only the final layer.&lt;/p&gt;

&lt;p&gt;The majority of the analytical work happened before the first visual was created.&lt;/p&gt;

&lt;p&gt;The process moved through several stages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw JCars Export
       ↓
Data Quality Investigation
       ↓
Power Query Cleaning
       ↓
Currency Standardization
       ↓
Business-Rule Validation
       ↓
Independent Revenue Calculation
       ↓
Star Schema Modelling
       ↓
DAX Measures
       ↓
Executive Dashboard
       ↓
Detailed Investigation
       ↓
Business Questions
       ↓
Insights
       ↓
Recommendations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each stage solved a different problem.&lt;/p&gt;

&lt;p&gt;Cleaning made the values usable.&lt;/p&gt;

&lt;p&gt;Validation established confidence in the cleaned data.&lt;/p&gt;

&lt;p&gt;Modelling created a structure suitable for analysis.&lt;/p&gt;

&lt;p&gt;DAX translated business definitions into reusable metrics.&lt;/p&gt;

&lt;p&gt;The dashboard made the information accessible.&lt;/p&gt;

&lt;p&gt;The investigation turned the visuals into questions.&lt;/p&gt;

&lt;p&gt;And the final recommendations connected those findings back to business decisions.&lt;/p&gt;

&lt;h1&gt;
  
  
  24. Challenges and Lessons Learned
&lt;/h1&gt;

&lt;p&gt;The biggest challenge was the variety of problems in the raw dataset.&lt;/p&gt;

&lt;p&gt;There was no single cleaning rule that could solve everything.&lt;/p&gt;

&lt;p&gt;Categorical errors required mapping.&lt;/p&gt;

&lt;p&gt;Dates required parsing.&lt;/p&gt;

&lt;p&gt;Currencies required detection and conversion.&lt;/p&gt;

&lt;p&gt;Numbers written as words required transformation.&lt;/p&gt;

&lt;p&gt;Missing values required documented treatment.&lt;/p&gt;

&lt;p&gt;Business-rule violations required investigation rather than simple replacement.&lt;/p&gt;

&lt;p&gt;This led to one of the most useful lessons from the project: &lt;strong&gt;data cleaning should be designed around the problems found in the data, not around a generic checklist.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The use of reusable functions such as &lt;code&gt;fnCat&lt;/code&gt;, &lt;code&gt;fnDate&lt;/code&gt; and &lt;code&gt;fnMoneyKES&lt;/code&gt; made the process much easier to maintain than a large collection of manual Power Query steps.&lt;/p&gt;

&lt;p&gt;Another important lesson was the importance of independently validating business metrics.&lt;/p&gt;

&lt;p&gt;The recorded Revenue field could not simply be assumed to be correct. Rebuilding revenue from units, price, discount and delivery fee provided an independent check and helped expose anomalies that might otherwise have flowed directly into the dashboard.&lt;/p&gt;

&lt;h1&gt;
  
  
  25. Conclusion
&lt;/h1&gt;

&lt;p&gt;The final JCars Logistics solution transformed a messy flat-file export into an interactive Power BI reporting model.&lt;/p&gt;

&lt;p&gt;The final model provided:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A cleaned and standardized dataset&lt;/li&gt;
&lt;li&gt;Reusable Power Query transformations&lt;/li&gt;
&lt;li&gt;A star-schema data model&lt;/li&gt;
&lt;li&gt;Surrogate-key dimensions&lt;/li&gt;
&lt;li&gt;DAX-based business metrics&lt;/li&gt;
&lt;li&gt;An Executive Dashboard&lt;/li&gt;
&lt;li&gt;A detailed analysis page&lt;/li&gt;
&lt;li&gt;Cross-filtering and slicers&lt;/li&gt;
&lt;li&gt;Drill-through analysis&lt;/li&gt;
&lt;li&gt;Business-quality checks&lt;/li&gt;
&lt;li&gt;Documented assumptions&lt;/li&gt;
&lt;li&gt;Management insights&lt;/li&gt;
&lt;li&gt;Data-driven recommendations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The resulting analysis showed that JCars Logistics generated &lt;strong&gt;KES 1.90 billion in revenue and KES 415.5 million in Gross Profit&lt;/strong&gt;, with a &lt;strong&gt;21.9% Gross Profit Margin&lt;/strong&gt; across 276 analysed order lines.&lt;/p&gt;

&lt;p&gt;More importantly, the project showed where that performance came from and where further investigation was needed: profitability was concentrated in a small number of vehicle makes and branches, WhatsApp-sourced orders were negative in aggregate Gross Profit, returns represented a significant share of orders, and a substantial portion of the dataset required data-quality intervention.&lt;/p&gt;

&lt;p&gt;The project therefore moved beyond simply answering &lt;strong&gt;"What happened?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It created a framework for asking:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Why did it happen, where is it happening, how reliable is the underlying data, and what should be investigated next?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is ultimately what turned the JCars dataset from a raw transactional export into a management analysis tool.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GITHUB:&lt;a href="https://github.com/gee-999/JCARS-LOGISTIC-ANALYSIS-PROJECT" rel="noopener noreferrer"&gt;https://github.com/gee-999/JCARS-LOGISTIC-ANALYSIS-PROJECT&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>messydataset</category>
      <category>powerbi</category>
      <category>datamodelling</category>
      <category>businesssolutions</category>
    </item>
    <item>
      <title>POWER BI: Data Modelling, Relationships &amp; Joins</title>
      <dc:creator>Gloria Adhiambo Awinja</dc:creator>
      <pubDate>Sun, 13 Sep 2026 12:16:31 +0000</pubDate>
      <link>https://dev.to/gloriaawinja/power-bi-data-modelling-relationships-joins-24lf</link>
      <guid>https://dev.to/gloriaawinja/power-bi-data-modelling-relationships-joins-24lf</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;When working with data in Power BI, having the data is only the beginning. The way that data is organized and connected can make a big difference in how easily we can analyze it and how reliable our reports become. In a real business environment, information is rarely stored in one simple table. Sales, customers, products, dates, and locations are often stored separately, which means Power BI needs to understand how these different pieces of information relate to each other.&lt;br&gt;
This is where &lt;strong&gt;data modelling, relationships, and joins&lt;/strong&gt; come in. Data modelling involves structuring tables and defining how they connect so that the data can be used effectively for reporting and analysis. Relationships allow Power BI to move filters between related tables, while Power Query joins allow us to combine data during the data preparation stage.&lt;br&gt;
In this article, I will explore the main data modelling approaches used in Power BI, including &lt;strong&gt;flat tables, star schemas, and snowflake schemas&lt;/strong&gt;. I will also explain the difference between &lt;strong&gt;fact and dimension tables&lt;/strong&gt;, how relationships and cardinality work, and how filter direction affects the way data behaves in a report. In addition, I will look at the different join types available in Power Query and explain how they differ from relationships in the Power BI data model.&lt;/p&gt;

&lt;p&gt;Rather than looking at these concepts only from a theoretical point of view, I will use a practical sales example throughout the article. This will help demonstrate not only what these concepts mean, but also &lt;strong&gt;why choosing the right structure and relationships matters when building a Power BI solution&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Data Modelling in Power BI
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Data modelling in Power BI&lt;/strong&gt; is the process of organizing your data into tables and creating relationships between those tables so that Power BI can understand how the data is connected.&lt;/p&gt;

&lt;p&gt;In our article today, we will be referencing electronic sales with entries like &lt;strong&gt;Sales ID, Date, Customer, Region, Product, Category, and Quantity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The purpose of data modelling is not simply to separate tables. It is to create a structure that allows Power BI to &lt;strong&gt;correctly filter, calculate, analyze, and present your data&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Importance of a well-designed data model.
&lt;/h3&gt;

&lt;p&gt;A good data model provides the foundation for your entire Power BI report.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Reporting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A proper model helps your charts, tables, slicers, and filters return the correct results.&lt;/p&gt;

&lt;p&gt;For example, if you data contains quantity of phones sold and you want to know the quantity sold at a particular region for example in &lt;strong&gt;California&lt;/strong&gt;, Power BI needs to understand the relationship between the sales and region information. With the correct relationships, selecting California automatically filters the relevant sales.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A good model makes it easier to look at your data from different perspectives.&lt;/p&gt;

&lt;p&gt;Using the same sales data, you might want to analyze:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quantity sold by region&lt;/li&gt;
&lt;li&gt;Quantity sold by customer&lt;/li&gt;
&lt;li&gt;Quantity sold by phone version&lt;/li&gt;
&lt;li&gt;Sales over time&lt;/li&gt;
&lt;li&gt;Performance of different products&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can do this without creating completely separate datasets for every analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. DAX calculations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data modelling is especially important when creating &lt;strong&gt;DAX measures&lt;/strong&gt;.&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(Sales[Quantity])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The measure can then be used with different fields such as Region, Customer, Version, or Date.&lt;/p&gt;

&lt;p&gt;If the relationships between your tables are correct, Power BI knows how those filters should affect the calculation. If the model is poorly designed, your DAX calculations can produce unexpected or incorrect results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The way you structure your data can affect how quickly Power BI processes calculations and displays your reports.&lt;/p&gt;

&lt;p&gt;A clean model avoids unnecessary duplication and complicated relationships, which can help Power BI work more efficiently, especially when dealing with large datasets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Scalability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A good model should still work when your data grows.&lt;br&gt;
For example, you might start with a few thousand sales records but later have hundreds of thousands or millions. You may also want to add information such as price, discount, payment method, or salesperson.&lt;br&gt;
A well-designed model makes it easier to add this information without rebuilding the entire report.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Maintainability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, a good model makes your Power BI project easier to understand and maintain.&lt;/p&gt;

&lt;p&gt;If you or another analyst needs to modify the report later, it should be clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What each table represents&lt;/li&gt;
&lt;li&gt;What each column means&lt;/li&gt;
&lt;li&gt;How the tables are related&lt;/li&gt;
&lt;li&gt;Which calculations are being used&lt;/li&gt;
&lt;li&gt;Where the data is coming from&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes troubleshooting and future changes much easier.&lt;/p&gt;

&lt;p&gt;data model is described as the foundation of your Power BI report.&lt;/p&gt;

&lt;p&gt;You can have beautiful dashboards and complicated DAX formulas, but if the underlying model is poorly designed, you can still end up with &lt;strong&gt;incorrect results, slow reports, and difficult-to-maintain solutions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So the basic idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organize the data → Create the right relationships → Build DAX calculations → Create visualizations → Get reliable insights.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A well-designed data model therefore supports &lt;strong&gt;accurate reporting, meaningful analytics, reliable DAX calculations, better performance, future growth, and easier maintenance&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, we are going to look at different approaches when it comes to data modelling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Flat Table&lt;/strong&gt;&lt;br&gt;
A flat table stores all the information in one table. Instead of separating information into fact and dimension tables, everything is kept together in a single dataset.&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%2Fgcdyz46m3qc3chtirz3a.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%2Fgcdyz46m3qc3chtirz3a.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are no relationships between separate tables because all the information is stored together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simple to understand, especially for beginners.&lt;/li&gt;
&lt;li&gt;Easy to import into Power BI.&lt;/li&gt;
&lt;li&gt;Does not require creating relationships between tables.&lt;/li&gt;
&lt;li&gt;Suitable for small and simple datasets.&lt;/li&gt;
&lt;li&gt;Quick to set up for simple reports.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can contain a lot of duplicated information.&lt;/li&gt;
&lt;li&gt;The dataset can become very large.&lt;/li&gt;
&lt;li&gt;Changes to descriptive information may have to be repeated in    many rows.
&lt;/li&gt;
&lt;li&gt;More difficult to maintain as the dataset grows.
Can use more memory.
It is not ideal for complex DAX calculations and large Power BI models.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Instances flat table is Appropriate&lt;/strong&gt;&lt;br&gt;
A flat table can be appropriate when:&lt;br&gt;
1.The dataset is small.&lt;br&gt;
2.The analysis is relatively simple.&lt;br&gt;
3.There are no complicated relationships between entities.&lt;br&gt;
4.A quick report or prototype is required.&lt;br&gt;
5.The source data is already provided as a single table.&lt;br&gt;
6.Power BI performance and complexity&lt;/p&gt;

&lt;p&gt;For small datasets, a flat table can perform reasonably well because there are no relationships to manage. However, as the number of rows and columns increases, the repeated information can increase the size of the model.&lt;/p&gt;

&lt;p&gt;Therefore, although a flat table is simple, it is generally less scalable than a well-designed dimensional model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Star Schema&lt;/strong&gt;&lt;br&gt;
A star schema is a data model where a central fact table is connected directly to several dimension tables.&lt;/p&gt;

&lt;p&gt;It is called a star schema because the structure looks like a star: the fact table is in the center while the dimension tables surround it.&lt;/p&gt;

&lt;p&gt;Structure&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%2Fc4a477u2aeeefxsmqvr1.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%2Fc4a477u2aeeefxsmqvr1.png" alt=" " width="600" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, our sample business 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;                  ┌──────────────────────┐
                  │       Dim Date       │
                  ├──────────────────────┤
                  │ PK  | Date Key       │
                  │     | Date           │
                  │     | Month          │
                  │     | Year           │
                  └──────────┬───────────┘
                             │ 1
                             │
                             │ N
┌──────────────────────┐  1  ▼  N ┌──────────────────────┐ N  1 ┌──────────────────────┐
│     Dim Customer     ├─────────►│      Fact Sales      │◄────────┤     Dim Product      │
├──────────────────────┤          ├──────────────────────┤         ├──────────────────────┤
│ PK  | Cust Key       │          │ FK  | Cust Key       │         │ PK  | Prod Key       │
│     | Cust Name      │          │ FK  | Prod Key       │         │     | Prod Name      │
│     | Segment        │          │ FK  | Date Key       │         │     | Category       │
└──────────────────────┘          │ FK  | Loc Key        │         │     | Brand          │
                                  │     | Quantity       │         └──────────────────────┘
                                  │     | SalesAmt       │
                                  └──────────┬───────────┘
                                             │ N
                                             │
                                             │ 1
                                  ┌──────────▼───────────┐
                                  │     Dim Location     │
                                  ├──────────────────────┤
                                  │ PK  | Loc Key        │
                                  │     | County         │
                                  │     | Region         │
                                  └──────────────────────┘

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Fact Sales table contains the business events, while the dimension tables provide information that describes those events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;br&gt;
1.Simple and easy to understand.&lt;br&gt;
2.Works very well with Power BI.&lt;br&gt;
3.Reduces unnecessary duplication.&lt;br&gt;
4.Makes relationships easier to manage.&lt;br&gt;
5.Makes DAX calculations easier to write.&lt;br&gt;
6.Generally provides good query performance.&lt;br&gt;
7.Easier to maintain than a large flat table.&lt;br&gt;
8.Scales better as the amount of data increases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;br&gt;
1.Requires more planning than a flat table.&lt;br&gt;
2.Requires relationships between tables.&lt;br&gt;
3.Poorly designed relationships can produce incorrect results.&lt;br&gt;
4.Users need to understand basic concepts such as primary keys, foreign keys, dimensions and facts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use a star schema&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Star schemas are particularly suitable for:&lt;br&gt;
1.Business intelligence dashboards.&lt;br&gt;
2.Sales analysis.&lt;br&gt;
3.Financial reporting.&lt;br&gt;
4.Customer analytics.&lt;br&gt;
5.Inventory analysis.&lt;br&gt;
6.Marketing analytics.&lt;br&gt;
7.Power BI reports with multiple dimensions and measures.&lt;br&gt;
8.Power BI performance and complexity&lt;/p&gt;

&lt;p&gt;The star schema is generally the recommended approach for Power BI models because it separates business events from descriptive information.&lt;/p&gt;

&lt;p&gt;For example, instead of storing the customer's name thousands of times in a sales table, the fact table can store a Customer Key and retrieve the customer's details from Dim Customer.&lt;/p&gt;

&lt;p&gt;This reduces unnecessary duplication and gives Power BI a more structured model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Snowflake Schema&lt;/strong&gt;&lt;br&gt;
Definition&lt;br&gt;
A snowflake schema is an extension of the star schema where dimension tables are further divided into additional related tables.&lt;/p&gt;

&lt;p&gt;In a star schema, dimensions are usually denormalized. In a snowflake schema, they are more normalized.&lt;/p&gt;

&lt;p&gt;Structure&lt;/p&gt;

&lt;p&gt;For example:&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%2Fjup42aq72phqwmo76sr1.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%2Fjup42aq72phqwmo76sr1.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;br&gt;
1.Reduces duplication within dimension tables.&lt;br&gt;
2.Provides a more normalized structure.&lt;br&gt;
3.Can be useful when dimensions contain complex hierarchies.&lt;br&gt;
4.Easier to manage certain large and complex datasets.&lt;br&gt;
5.Can improve data consistency because information is maintained in one place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.More tables and relationships.&lt;br&gt;
2.More complicated than a star schema.&lt;br&gt;
3.Can make the Power BI model harder for users to understand.&lt;br&gt;
4.More relationships can increase modelling complexity.&lt;br&gt;
5.Queries may require more joins.&lt;br&gt;
6.Can make DAX and report development more complicated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use snowflake schema .&lt;/strong&gt;&lt;br&gt;
A snowflake schema may be useful when:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dimension data is very large.&lt;/li&gt;
&lt;li&gt;Dimensions have multiple levels of hierarchy.&lt;/li&gt;
&lt;li&gt;There is substantial duplication within dimensions.&lt;/li&gt;
&lt;li&gt;Data consistency is particularly important.
5.The organization already uses highly normalized databases.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Although a snowflake schema can reduce duplicated data, it introduces additional relationships. This can make the model more complex and potentially require Power BI to perform more relationship traversals.&lt;/p&gt;

&lt;p&gt;For many Power BI reporting scenarios, a star schema is preferred over a snowflake schema because it provides a good balance between performance, simplicity, and maintainability.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Flat Table&lt;/th&gt;
&lt;th&gt;Star Schema&lt;/th&gt;
&lt;th&gt;Snowflake Schema&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Number of Tables&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One&lt;/td&gt;
&lt;td&gt;Several&lt;/td&gt;
&lt;td&gt;Several (including sub-dimensions)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Relationships&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Fact → Dimensions&lt;/td&gt;
&lt;td&gt;Fact → Dimensions → Sub-dimensions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Duplication&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Lower&lt;/td&gt;
&lt;td&gt;Very low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ease of Understanding&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Very easy&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;More difficult&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power BI Suitability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Small/simple models&lt;/td&gt;
&lt;td&gt;Excellent&lt;/td&gt;
&lt;td&gt;Good for complex models&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Good for small data&lt;/td&gt;
&lt;td&gt;Generally very good&lt;/td&gt;
&lt;td&gt;Can be affected by additional relationships&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Maintenance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple initially&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;More complex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Typical Use&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple analysis&lt;/td&gt;
&lt;td&gt;BI / Reporting&lt;/td&gt;
&lt;td&gt;Complex normalized data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A flat table is the simplest approach but becomes difficult to manage as data grows.&lt;/p&gt;

&lt;p&gt;A star schema provides a good balance between simplicity, performance, and scalability and is therefore commonly recommended for Power BI.&lt;/p&gt;

&lt;p&gt;A snowflake schema provides greater normalization but introduces more relationships and therefore more complexity.&lt;/p&gt;
&lt;h1&gt;
  
  
  Relationships, Filter Direction and Joins in Power BI
&lt;/h1&gt;

&lt;p&gt;Creating tables is only part of building a good Power BI data model. The next important step is making sure Power BI understands how those tables are connected. This is where &lt;strong&gt;relationships&lt;/strong&gt; become important.&lt;/p&gt;

&lt;p&gt;In a typical electronic sales project, data is usually stored in several tables rather than one large table. For example, a sales system may have a &lt;code&gt;Fact Sales&lt;/code&gt; table containing transactions, a &lt;code&gt;Dim Customer&lt;/code&gt; table containing customer information, a &lt;code&gt;Dim Product&lt;/code&gt; table containing product information, and a &lt;code&gt;Dim Date&lt;/code&gt; table containing dates.&lt;/p&gt;

&lt;p&gt;Relationships tell Power BI how these tables are connected and allow filters and calculations to work across them.&lt;/p&gt;
&lt;h1&gt;
  
  
  1. Relationships in Power BI
&lt;/h1&gt;

&lt;p&gt;A relationship in Power BI is a connection between two tables based on a column that the tables have in common.&lt;/p&gt;

&lt;p&gt;For example, &lt;strong&gt;Dim Customer&lt;/strong&gt; may contain:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;th&gt;Region&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;Nairobi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;Mombasa&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;Kisumu&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;While &lt;strong&gt;Fact Sales&lt;/strong&gt; may contain:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sales ID&lt;/th&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Product&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;S001&lt;/td&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;Phone&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S002&lt;/td&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Laptop&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S003&lt;/td&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;Tablet&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S004&lt;/td&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Phone&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both tables contain &lt;strong&gt;Customer ID&lt;/strong&gt;. Power BI can use this column to establish a relationship.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               ┌─────────────────────┐
               │     Dim Customer    │
               ├─────────────────────┤
               │ PK | Customer ID    │
               │    | Customer Name  │
               │    | Region         │
               └──────────┬──────────┘
                          │
                          │ 1  (One)
                          │
                   Key: CustomerID
                          │
                          │ *  (Many)
                          ▼
               ┌─────────────────────┐
               │      FactSales      │
               ├─────────────────────┤
               │ PK | SalesID        │
               │ FK | CustomerID     │
               │    | Product        │
               │    | Quantity       │
               └─────────────────────┘

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without this relationship, Power BI would not automatically know that &lt;code&gt;C001&lt;/code&gt; in the sales table refers to John in the customer table.&lt;/p&gt;

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

&lt;p&gt;Understanding keys is important when creating relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Primary Key
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;primary key&lt;/strong&gt; is a column that uniquely identifies each record in a table.&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;Dim Customer

Customer ID
C001
C002
C003
C004
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each Customer ID appears only once, making it suitable as a primary key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Foreign Key
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;foreign key&lt;/strong&gt; is a column used to refer to a record in another table.&lt;/p&gt;

&lt;p&gt;In FactSales, the same CustomerID can appear many times:&lt;br&gt;
&lt;/p&gt;

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

Customer ID
C001
C002
C001
C003
C001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This happens because one customer can make multiple purchases.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer[Customer ID]  →  unique
Fact Sales[Customer ID]    →  can repeat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what creates a typical &lt;strong&gt;one-to-many relationship&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;Cardinality describes how many records in one table can be associated with records in another table.&lt;/p&gt;

&lt;p&gt;The main relationship types are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-to-Many (1:*)&lt;/li&gt;
&lt;li&gt;One-to-One (1:1)&lt;/li&gt;
&lt;li&gt;Many-to-Many (&lt;em&gt;:&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;One-to-many is the most common relationship in a Power BI star schema.&lt;/p&gt;

&lt;p&gt;It means that one record in one table can be related to many records in another table.&lt;/p&gt;

&lt;p&gt;For example, one customer can make many sales.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer                         Fact Sales

Customer ID                         Customer ID
C001 ─────────────────────────────► C001
                                    C001
                                    C001
C002 ─────────────────────────────► C002
                                    C002
C003 ─────────────────────────────► C003
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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;Dim Customer        Fact Sales
     1                 *
     │                 │
     └─────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;1&lt;/code&gt; side contains unique values, while the &lt;code&gt;*&lt;/code&gt; side can contain repeated values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Practical example
&lt;/h3&gt;

&lt;p&gt;A company may have one customer record:&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 | Nairobi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but John may have purchased several products:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C001 | Phone
C001 | Laptop
C001 | Headphones
C001 | Tablet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore:&lt;/p&gt;

&lt;p&gt;Dim Customer → Fact Sales = 1:* &lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;This is normally the preferred relationship when working with a star schema.&lt;/p&gt;

&lt;p&gt;Typical examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dim Customer → Fact Sales&lt;/li&gt;
&lt;li&gt;Dim Product → Fact Sales&lt;/li&gt;
&lt;li&gt;Dim Date → Fact Sales&lt;/li&gt;
&lt;li&gt;Dim Location → Fact Sales&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;It should not be used simply because two tables have a similar column name. The values and meaning of the keys must actually represent a valid relationship.&lt;/p&gt;

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

&lt;p&gt;A one-to-one relationship means that one record in one table corresponds to only one record in another table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Table A                     Table B

ID 1 ─────────────────────► ID 1
ID 2 ─────────────────────► ID 2
ID 3 ─────────────────────► ID 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, an organization might have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employee
Employee ID| Employee Name
001        | Jane
002        | Peter
003        | Mary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and a separate table containing employee payroll information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employee Payroll
Employee ID| Salary
001        | 80,000
002        | 75,000
003        | 90,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each employee has one corresponding payroll record.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;A 1:1 relationship can be useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A table contains additional information that logically belongs to the same entity.&lt;/li&gt;
&lt;li&gt;Sensitive or restricted information is kept separately.&lt;/li&gt;
&lt;li&gt;A very wide table has been intentionally split into smaller tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When not to use it.
&lt;/h3&gt;

&lt;p&gt;If the two tables represent essentially the same information and can be combined without creating problems, a 1:1 relationship may unnecessarily complicate the model.&lt;/p&gt;

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

&lt;p&gt;A many-to-many relationship occurs when many records in one table can be related to many records in another table.&lt;/p&gt;

&lt;p&gt;For example, students and courses:&lt;br&gt;
&lt;/p&gt;

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

Student A ───────────────────► Course 1
Student A ───────────────────► Course 2

Student B ───────────────────► Course 1
Student B ───────────────────► Course 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One student can take many courses, while one course can have many students.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Students             Courses
   *                    *
    \                  /
     \                /
      ────────────────
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a real database, this type of relationship is often handled using a &lt;strong&gt;bridge/junction table&lt;/strong&gt;:&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:*
     ▼
BridgeStudentCourse
     │
     │ *:1
     ▼
DimCourse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;Many-to-many relationships can be useful when the underlying business relationship genuinely allows multiple matches on both sides.&lt;/p&gt;

&lt;h3&gt;
  
  
  When not to use it.
&lt;/h3&gt;

&lt;p&gt;They should not be used as a quick solution for a poorly designed model.&lt;/p&gt;

&lt;p&gt;Direct many-to-many relationships can make filter propagation and DAX calculations more difficult and may produce unexpected results.&lt;/p&gt;

&lt;p&gt;Where possible, a bridge table or a clearer star-schema design is usually preferable.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Referential Integrity
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Referential integrity&lt;/strong&gt; means that values used as foreign keys should correspond to valid records in the related table.&lt;/p&gt;

&lt;p&gt;For example, if &lt;code&gt;Fact Sales&lt;/code&gt; contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer ID
C001
C002
C003
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then those customers should normally exist in &lt;code&gt;Dim Customer&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer
C001 ✓
C002 ✓
C003 ✓

Fact Sales
C001 ✓
C002 ✓
C003 ✓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the sales table contains &lt;code&gt;C999&lt;/code&gt;, but &lt;code&gt;C999&lt;/code&gt; does not exist in &lt;code&gt;Dim Customer&lt;/code&gt;, the relationship has a missing match.&lt;/p&gt;

&lt;p&gt;This can lead to blank or unexpected results in reports.&lt;/p&gt;

&lt;p&gt;Good data modelling therefore involves checking that keys are valid and that relationships make business sense.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Active and Inactive Relationships
&lt;/h1&gt;

&lt;p&gt;Power BI can have relationships between the same tables that are not all active at the same time.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;active relationship&lt;/strong&gt; is the relationship Power BI uses automatically when filtering and calculating data.&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;Dim Date[Date] ───────► Fact Sales[Order Date]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This could be the active relationship.&lt;/p&gt;

&lt;p&gt;However, a sales table might also contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order Date&lt;/li&gt;
&lt;li&gt;Shipping Date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The date table could therefore have two possible relationships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Date ───────► Fact Sales[Order Date]       ACTIVE

Dim Date ───────► Fact Sales[Shipping Date]    INACTIVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The inactive relationship can still be used in specific DAX calculations when required.&lt;/p&gt;

&lt;p&gt;This is useful when the same fact table contains different dates that need to be analyzed separately.&lt;/p&gt;

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

&lt;p&gt;Relationships do more than connect tables. They also determine how filters move between tables.&lt;/p&gt;

&lt;p&gt;Suppose we have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Product
     │
     │
     ▼
Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the relationship uses &lt;strong&gt;single-direction filtering&lt;/strong&gt;, selecting &lt;code&gt;Phone&lt;/code&gt; from &lt;code&gt;Dim Product&lt;/code&gt; filters the related records in &lt;code&gt;Fact Sales&lt;/code&gt;.&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;Dim Product

Product
-------
Phone      ← Selected
Laptop
Tablet

          ↓ filter

Fact Sales

Product    Quantity
Phone         2
Phone         1
Phone         4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sales table now shows only sales associated with the selected product.&lt;/p&gt;

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

&lt;p&gt;Single-direction filtering normally moves from the dimension table towards the fact table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Product
     │
     │ Filter
     ▼
Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is generally the preferred approach for a star schema because the direction of filtering is clear and predictable.&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;Dim Customer ───────► Fact Sales
Dim Product  ───────► Fact Sales
Dim Date     ───────► Fact Sales
Dim Location ───────► Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dimensions filter the fact table.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Bidirectional Filtering
&lt;/h1&gt;

&lt;p&gt;Bidirectional filtering allows filters to move in both directions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Product
     ▲
     │
     ▼
Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can sometimes be useful, but it should be used carefully.&lt;/p&gt;

&lt;p&gt;For example, if a product is selected, the sales table can be filtered. With bidirectional filtering, filters can also travel back from the sales table towards the product table.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reason it may cause a problem.
&lt;/h3&gt;

&lt;p&gt;Consider a model with several connected tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer ───► Fact Sales ◄─── Dim Product
       ▲                         ▲
       │                         │
       └──────────────┬──────────┘
                      │
                 Other tables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If filters are allowed to travel in both directions, Power BI can end up with multiple possible paths between tables.&lt;/p&gt;

&lt;p&gt;This can create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ambiguous filter paths.&lt;/li&gt;
&lt;li&gt;Unexpected filtering.&lt;/li&gt;
&lt;li&gt;More complicated DAX behavior.&lt;/li&gt;
&lt;li&gt;Difficult-to-debug reports.&lt;/li&gt;
&lt;li&gt;Additional model complexity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, &lt;strong&gt;single-direction filtering is generally preferred unless there is a clear reason to use bidirectional filtering.&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;Relationships are not the only way to work with multiple tables.&lt;br&gt;
Power Query provides another approach called &lt;strong&gt;Merge Queries&lt;/strong&gt;.&lt;br&gt;
A &lt;strong&gt;join&lt;/strong&gt; combines two tables based on one or more matching columns.&lt;/p&gt;

&lt;p&gt;For example, suppose we have:&lt;/p&gt;
&lt;h3&gt;
  
  
  Customers
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C004&lt;/td&gt;
&lt;td&gt;Jane&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Orders
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;O001&lt;/td&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O002&lt;/td&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O003&lt;/td&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;20,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O004&lt;/td&gt;
&lt;td&gt;C005&lt;/td&gt;
&lt;td&gt;15,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The tables can be merged using &lt;code&gt;Customer ID&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Power Query provides several join types.&lt;/p&gt;
&lt;h1&gt;
  
  
  9. Left Outer Join
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;Left Outer Join&lt;/strong&gt; keeps all records from the left table and matching records from the right table.&lt;br&gt;
&lt;/p&gt;

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

C001 ─────────────────────── C001 ✓
C002 ─────────────────────── C002 ✓
C003 ─────────────────────── no match
C004 ─────────────────────── no match
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O001&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;O002&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C004&lt;/td&gt;
&lt;td&gt;Jane&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The customers table determines which records are retained.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;A company wants a list of &lt;strong&gt;all customers&lt;/strong&gt;, including customers who have never placed an order.&lt;/p&gt;

&lt;h1&gt;
  
  
  10. Right Outer Join
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;Right Outer Join&lt;/strong&gt; keeps all records from the right table and matching records from the left table.&lt;br&gt;
&lt;/p&gt;

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

C001 ─────────────────────── C001 ✓
C002 ─────────────────────── C002 ✓
C003
C004
                             C005 ← no customer match
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O001&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;O002&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O003&lt;/td&gt;
&lt;td&gt;20,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C005&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;O004&lt;/td&gt;
&lt;td&gt;15,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;This could be useful when the orders table is the primary table and the objective is to retain &lt;strong&gt;every order&lt;/strong&gt;, even where customer information is missing.&lt;/p&gt;

&lt;p&gt;In practice, a left join is often easier to understand because you can simply place the table you want to preserve on the left.&lt;/p&gt;

&lt;h1&gt;
  
  
  11. Full Outer Join
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;Full Outer Join&lt;/strong&gt; keeps all records from both tables, whether they match or not.&lt;br&gt;
&lt;/p&gt;

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

C001 ─────────────────────── C001 ✓
C002 ─────────────────────── C002 ✓
C003 ─────────────────────── no match
C004 ─────────────────────── no match

                             C005 ← no customer match
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O001&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;O002&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O003&lt;/td&gt;
&lt;td&gt;20,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C004&lt;/td&gt;
&lt;td&gt;Jane&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C005&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;O004&lt;/td&gt;
&lt;td&gt;15,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;A full outer join can be useful when checking data quality and identifying unmatched records on &lt;strong&gt;both sides&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, it can help identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customers without orders.&lt;/li&gt;
&lt;li&gt;Orders without valid customers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  12. Inner Join
&lt;/h1&gt;

&lt;p&gt;An &lt;strong&gt;Inner Join&lt;/strong&gt; keeps only records that have a match in 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;Customers                    Orders

C001 ─────────────────────── C001 ✓
C002 ─────────────────────── C002 ✓
C003                         no match
C004                         no match

                             C005
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O001&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C002&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;O002&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C001&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;O003&lt;/td&gt;
&lt;td&gt;20,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Customers without orders are removed, and orders without a matching customer are also removed.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;An inner join is appropriate when only records that exist in &lt;strong&gt;both datasets&lt;/strong&gt; are relevant.&lt;/p&gt;

&lt;h1&gt;
  
  
  13. Left Anti Join
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;Left Anti Join&lt;/strong&gt; returns records from the left table that do &lt;strong&gt;not&lt;/strong&gt; have a matching record in the right table.&lt;br&gt;
&lt;/p&gt;

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

C001 ─────────────────────── C001
C002 ─────────────────────── C002
C003  ← retained
C004  ← retained

                             C005
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Customer Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C003&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C004&lt;/td&gt;
&lt;td&gt;Jane&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are customers who have &lt;strong&gt;no matching orders&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;This is particularly useful for data quality checks.&lt;/p&gt;

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

&lt;p&gt;Which customers have registered but never placed an order?&lt;/p&gt;

&lt;h1&gt;
  
  
  14. Right Anti Join
&lt;/h1&gt;

&lt;p&gt;A &lt;strong&gt;Right Anti Join&lt;/strong&gt; returns records from the right table that do not have a matching record in the left table.&lt;/p&gt;

&lt;p&gt;In our example:&lt;br&gt;
&lt;/p&gt;

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

C001 ─────────────────────── C001
C002 ─────────────────────── C002
C003
C004

           C005 ← retained
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C005&lt;/td&gt;
&lt;td&gt;O004&lt;/td&gt;
&lt;td&gt;15,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This identifies an order whose customer does not exist in the Customers table.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use it.
&lt;/h3&gt;

&lt;p&gt;It can be used to identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invalid customer IDs.&lt;/li&gt;
&lt;li&gt;Orphan transactions.&lt;/li&gt;
&lt;li&gt;Data entry errors.&lt;/li&gt;
&lt;li&gt;Missing master data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  15. Summary of Power Query Join Types
&lt;/h1&gt;

&lt;p&gt;To summarize this we ould say:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Join Type&lt;/th&gt;
&lt;th&gt;Records Retained&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;All left + matching right&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Right Outer&lt;/td&gt;
&lt;td&gt;All right + matching left&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full Outer&lt;/td&gt;
&lt;td&gt;All records from both tables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inner&lt;/td&gt;
&lt;td&gt;Only matching records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Left Anti&lt;/td&gt;
&lt;td&gt;Left records with no match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Right Anti&lt;/td&gt;
&lt;td&gt;Right records with no match&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  16. Power Query Joins vs Power BI Relationships
&lt;/h1&gt;

&lt;p&gt;Although joins and relationships both involve connecting tables, they do fundamentally different things.&lt;/p&gt;

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

&lt;p&gt;A &lt;strong&gt;Merge Query&lt;/strong&gt; happens during the &lt;strong&gt;data preparation stage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It can physically bring columns from one table into another.&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;Customers
Customer ID| Customer Name
C001       | John

        +

Orders
Customer ID| Order ID| Amount
C001       | O001    | 50,000

        ↓ Merge

Combined Table
Customer ID| Customer Name| Order ID| Amount
C001       | John         | O001    | 50,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a new table containing information from both sources.&lt;/p&gt;

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

&lt;p&gt;A relationship does not physically merge the tables.&lt;/p&gt;

&lt;p&gt;Instead, the tables remain separate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer                   Fact Sales

Customer ID                    Customer ID
Customer Name                  Sales ID
Region                         Product ID
                               Amount

       1 ───────────────── * 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Power BI understands that the tables are connected and uses the relationship when filtering and calculating.&lt;/p&gt;

&lt;h1&gt;
  
  
  17. When to Merge Instead of Create a Relationship.
&lt;/h1&gt;

&lt;p&gt;A merge is useful when two pieces of information logically belong together and you want them available in the same table.&lt;/p&gt;

&lt;p&gt;For example, if a product table contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Product ID
Product Name
Category ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and a small lookup table contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Category ID
Category Name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you may merge the category name into the product table during Power Query transformation.&lt;br&gt;
However, you should not automatically merge every table.&lt;br&gt;
For example, it is usually better to keep:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer
Dim Product
Dim Date
Dim Location
Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as separate tables rather than creating one enormous table.&lt;/p&gt;

&lt;h1&gt;
  
  
  18. Why Excessive Merging Can Be a Problem
&lt;/h1&gt;

&lt;p&gt;Imagine taking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fact Sales
+
Customer
+
Product
+
Date
+
Location
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and merging everything into one table.&lt;/p&gt;

&lt;p&gt;The result may be a very wide table containing repeated information.&lt;/p&gt;

&lt;p&gt;For example, if John makes 1,000 purchases, his customer information could be repeated across many rows.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Increase redundancy.&lt;/li&gt;
&lt;li&gt;Make the model harder to maintain.&lt;/li&gt;
&lt;li&gt;Increase the number of columns in the fact table.&lt;/li&gt;
&lt;li&gt;Make the data model less intuitive.&lt;/li&gt;
&lt;li&gt;Make changes to dimensions more difficult.&lt;/li&gt;
&lt;li&gt;Move the model away from a clean star schema.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, merging should be done when there is a genuine data-preparation reason, not simply because tables are related.&lt;/p&gt;

&lt;h1&gt;
  
  
  19. Recommended Power BI Model
&lt;/h1&gt;

&lt;p&gt;For a typical business intelligence project, I would generally recommend a &lt;strong&gt;star schema&lt;/strong&gt; rather than a flat table or a highly normalized snowflake schema.&lt;/p&gt;

&lt;p&gt;A typical model could 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;                         ┌───────────────┐
                         │    Dim Date   │
                         └───────┬───────┘
                                 │ 1:*
                                 ▼
┌───────────────┐        ┌───────────────┐        ┌───────────────┐
│ Dim Customer  │        │   Fact Sales  │        │  Dim Product   │
│               │ 1:*    │               │    *:1 │               │
└───────┬───────┘───────►│ Customer ID    │◄───────┴───────────────┘
        │                 │ Product ID    │
        │                 │ Date Key      │
        │                 │ Location ID   │
        │                 │ Quantity      │
        │                 │ Sales Amount  │
        │                 └───────┬───────┘
        │                         │ *:1
        │                         ▼
        │                 ┌───────────────┐
        └────────────────►│ Dim Location  │
                          └───────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fact table contains the transactions, while the dimensions describe those transactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reasons to choose a star schema?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt;&lt;br&gt;
A well-designed star schema generally works efficiently in Power BI because the model has clear relationships and avoids unnecessary duplication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAX simplicity:&lt;/strong&gt;&lt;br&gt;
Measures 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;Total Sales = SUM(Fact Sales[Sales Amount])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can be easily evaluated and then analyzed using dimensions such as product, customer, or date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model readability:&lt;/strong&gt;&lt;br&gt;
It is easy to understand what each table does. Fact tables contain events, while dimensions provide context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt;&lt;br&gt;
New products, customers, locations, or dates can be added to their respective dimensions without redesigning the entire model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintainability:&lt;/strong&gt;&lt;br&gt;
If a customer's region changes, the customer information can be updated in the dimension rather than being repeated across thousands of transaction records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reduced redundancy:&lt;/strong&gt;&lt;br&gt;
Descriptive information is stored once instead of repeatedly in every transaction.&lt;/p&gt;
&lt;h1&gt;
  
  
  20. Recommended Relationships and Filter Direction
&lt;/h1&gt;

&lt;p&gt;For a typical star schema, I would normally use &lt;strong&gt;one-to-many relationships&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer  1 ───── * Fact Sales
Dim Product   1 ───── * Fact Sales
Dim Date      1 ───── * Fact Sales
Dim Location  1 ───── * Fact  Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dimension tables would normally be on the &lt;strong&gt;one side&lt;/strong&gt;, while the fact table would be on the &lt;strong&gt;many side&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I would also normally use &lt;strong&gt;single-direction filtering&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dim Customer ───────► Fact Sales
Dim Product  ───────► Fact Sales
Dim Date     ───────► Fact Sales
Dim Location ───────► Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a clear filtering path.&lt;/p&gt;

&lt;p&gt;For example, selecting &lt;strong&gt;Smartphones&lt;/strong&gt; in &lt;code&gt;Dim Product&lt;/code&gt; filters &lt;code&gt;Fact Sales&lt;/code&gt; to only smartphone transactions. Selecting &lt;strong&gt;2026&lt;/strong&gt; in &lt;code&gt;Dim Date&lt;/code&gt; filters the sales to transactions occurring in that year.&lt;/p&gt;

&lt;p&gt;Bidirectional filtering would only be introduced when there is a specific modelling requirement that cannot be handled cleanly with single-direction filtering.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Relationships, joins, and filter direction all play important but different roles in Power BI. A &lt;strong&gt;relationship&lt;/strong&gt; connects tables in the Power BI data model without physically combining them. It allows filters and calculations to move between related tables.&lt;br&gt;
A &lt;strong&gt;Power Query merge&lt;/strong&gt;, on the other hand, combines data during the data preparation stage and can physically bring columns from one table into another.&lt;br&gt;
For relationships, &lt;strong&gt;one-to-many&lt;/strong&gt; is the most common cardinality in a well-designed star schema. One-to-one relationships can be useful in specific situations, while many-to-many relationships should be used carefully because they can introduce additional complexity.&lt;br&gt;
Filter direction also matters. &lt;strong&gt;Single-direction filtering&lt;/strong&gt; is normally preferred because it creates a predictable flow from dimensions to fact tables. Bidirectional filtering can be useful, but unnecessary use can create ambiguous filter paths and make the model harder to understand.&lt;br&gt;
For Power Query, the different join types provide flexibility for combining and validating data. Inner joins keep matches, outer joins preserve records from one or both tables, while anti joins are particularly useful for finding unmatched records.&lt;br&gt;
For a typical Power BI business intelligence solution, I would choose a &lt;strong&gt;star schema with one-to-many relationships and primarily single-direction filtering&lt;/strong&gt;. This approach provides a good balance of performance, DAX simplicity, readability, scalability, low redundancy, and maintainability. More importantly, it keeps the model understandable: the &lt;strong&gt;fact table records what happened, while the dimension tables explain who, what, when, and where it happened&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>datamodelling</category>
      <category>relationships</category>
      <category>joins</category>
      <category>powerbi</category>
    </item>
    <item>
      <title>Building an Interactive Excel Dashboard for E-commerce Product Analysis: A Case Study of Jumia Products</title>
      <dc:creator>Gloria Adhiambo Awinja</dc:creator>
      <pubDate>Sat, 05 Sep 2026 21:44:47 +0000</pubDate>
      <link>https://dev.to/gloriaawinja/building-an-interactive-excel-dashboard-for-e-commerce-product-analysis-a-case-study-of-jumia-285c</link>
      <guid>https://dev.to/gloriaawinja/building-an-interactive-excel-dashboard-for-e-commerce-product-analysis-a-case-study-of-jumia-285c</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;E-business platforms generate large amounts of product data, including prices, discounts, ratings, and customer reviews. When properly analyzed, this information can help sellers and businesses understand product performance and identify areas that may require attention.&lt;br&gt;
For this project, I built an interactive Excel dashboard for Jumia product analysis. The project focused on transforming raw product data into a structured dataset, performing exploratory analysis, and presenting the results through an interactive dashboard.&lt;br&gt;
The main objective was to investigate relationships between price, discount, rating, and customer reviews, while identifying products with strong or weak performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Project Objective
&lt;/h2&gt;

&lt;p&gt;The main objective was to build an interactive Excel dashboard that could answer questions about Jumia product performance.&lt;br&gt;
Specifically, I wanted to understand:&lt;br&gt;
• Whether larger discounts were associated with more customer reviews.&lt;br&gt;
• Whether highly rated products attracted stronger review engagement.&lt;br&gt;
• Whether product price and rating appeared to move together.&lt;br&gt;
• Which products had the highest and lowest ratings.&lt;br&gt;
• Which products had the highest discounts.&lt;br&gt;
• Which products generated the most reviews.&lt;br&gt;
• Which products might require additional pricing, marketing, or product-quality attention.&lt;br&gt;
An important consideration throughout the project was that reviews were treated as a proxy for customer engagement, not as a measure of sales or revenue.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Dataset and Business Questions
&lt;/h3&gt;

&lt;p&gt;The dataset contained information about 112 Jumia products.&lt;br&gt;
The analysis focused on product-level variables such as:&lt;br&gt;
• Product&lt;br&gt;
• Current Price&lt;br&gt;
• Old Price&lt;br&gt;
• Discount&lt;br&gt;
• Rating&lt;br&gt;
• Reviews&lt;br&gt;
The business questions guiding the analysis were:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Does a higher discount correspond to more reviews?&lt;/li&gt;
&lt;li&gt; Do highly rated products receive more reviews?&lt;/li&gt;
&lt;li&gt; Is there a relationship between current price and rating?&lt;/li&gt;
&lt;li&gt; Which products have the highest ratings?&lt;/li&gt;
&lt;li&gt; Which products have the lowest ratings?&lt;/li&gt;
&lt;li&gt; Which products have the highest discounts?&lt;/li&gt;
&lt;li&gt; Which products have the highest number of reviews?&lt;/li&gt;
&lt;li&gt; Are there products with high discounts but relatively weak ratings or engagement?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These questions helped determine which calculations, PivotTables, and visualizations were needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Initial Data-Quality Audit
&lt;/h3&gt;

&lt;p&gt;Before making changes to the dataset, I performed a data-quality audit to understand the condition of the raw data.&lt;br&gt;
The audit focused on:&lt;br&gt;
• Number of rows and columns=116&lt;br&gt;
• Blank or missing values =55 each for two columns&lt;br&gt;
• Duplicate records =2&lt;br&gt;
• Price ranges =2&lt;br&gt;
• Misspelled column header=1&lt;br&gt;
• Improperly written product names=1&lt;br&gt;
One of the most important findings from the audit was the presence of missing ratings.&lt;br&gt;
Out of the 112 products, 55 products had no recorded rating and review, meaning that approximately 49.1% of the products lacked rating and review information.&lt;br&gt;
This was important because rating-based and review-based analysis could only be performed reliably on the products with available ratings.&lt;br&gt;
The original dataset was preserved rather than overwritten so that the cleaning process remained traceable.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cleaning and Preparation Decisions
&lt;/h3&gt;

&lt;p&gt;The raw data was kept separate from the cleaned dataset. This ensured that the original data remained available for comparison and verification.&lt;br&gt;
The cleaned dataset was then prepared for analysis by:&lt;br&gt;
• Checking and correcting data types.&lt;br&gt;
• Handling missing values where appropriate.&lt;br&gt;
• Ensuring prices were treated as numerical values.&lt;br&gt;
• Ensuring discount values were represented consistently as percentages.&lt;br&gt;
• Checking rating and review fields.&lt;br&gt;
• Creating additional analytical fields.&lt;br&gt;
• Converting the cleaned range into an Excel Table for easier reference and analysis.&lt;br&gt;
The cleaned table was named &lt;strong&gt;cleaned&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Excel Formulas and Enrichment Fields
&lt;/h3&gt;

&lt;p&gt;After cleaning the dataset, I created additional fields to support the analysis. Some of these tables were:&lt;br&gt;
&lt;strong&gt;Discount Amount&lt;/strong&gt; &lt;br&gt;
The discount was calculated from the difference between the old price and current price.&lt;br&gt;
For example:&lt;br&gt;
&lt;code&gt;= [Old Price]- [Current Price]]&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Rating Categories&lt;/strong&gt;&lt;br&gt;
Products were also classified according to their rating to make it easier to analyze rating quality.&lt;br&gt;
The categories were designed to distinguish products with poor, average, and excellent ratings.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;=IF([Rating]="","Missing”, IF([@Rating] &amp;lt;3,"Poor”, IF([@Rating] &amp;lt;=4.5,"Average","Excellent")))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This classification made it easier to summarize rating performance using PivotTables.&lt;/p&gt;

&lt;p&gt;These enrichment fields transformed the original variables into categories that could be used for business-oriented analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. PivotTable and Analysis Workflow
&lt;/h3&gt;

&lt;p&gt;After preparing the cleaned dataset, I created PivotTables to summarize the data. This was vital because some of these tables would bring about slicers and graphs that would be used to represent data on the dashboard.&lt;br&gt;
The PivotTables were used to investigate:&lt;br&gt;
• Distribution Rating.&lt;br&gt;
• Discount distribution.&lt;br&gt;
• Price versus rating.&lt;br&gt;
• Engagement by discount category.&lt;br&gt;
• Top products by rating.&lt;br&gt;
• Bottom products by rating.&lt;br&gt;
• Top products by discount.&lt;br&gt;
• Top products by reviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Relationship Analysis
&lt;/h3&gt;

&lt;p&gt;To investigate relationships between numerical variables, I created scatter plots with trendlines.&lt;br&gt;
The three relationships analyzed were:&lt;br&gt;
&lt;strong&gt;Discount vs Reviews&lt;/strong&gt;&lt;br&gt;
The calculated correlation for this was 0.0440, which indicated a very weak relationship.&lt;br&gt;
The analysis therefore did not suggest that discount percentage strongly explained differences in review engagement.&lt;br&gt;
&lt;strong&gt;Rating vs Reviews&lt;/strong&gt;&lt;br&gt;
The calculated correlation was 0.0572, indicating a very weak positive relationship.&lt;br&gt;
This suggested that rating alone did not strongly explain differences in review engagement.&lt;br&gt;
&lt;strong&gt;Current Price vs Rating&lt;/strong&gt;&lt;br&gt;
The calculated correlation was 0.1101, indicating a very weak relationship.&lt;br&gt;
The analysis therefore provided limited evidence of a meaningful relationship between current price and rating.&lt;br&gt;
These analyses however, reinforced an important lesson, that a single variable should not automatically be treated as the main driver of product performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Dashboard Design and Slicer Connections
&lt;/h3&gt;

&lt;p&gt;The final stage of the project was to transform the analysis into an interactive dashboard. At the topmost of the Dashboard was the heading/header written in bold formart and a large font size. Beneath it was 5 key performance indicators commonly known as KPI's. They included&lt;br&gt;
• Total Products: 112&lt;br&gt;
• Average Current Price: Ksh 1,186.89&lt;br&gt;
• Average Discount: 0.365089286&lt;br&gt;
• Average Rating: 3.889474&lt;br&gt;
• Total Reviews: 723&lt;br&gt;
Beneath this KPI's were three slicers that allowed the dashboard to be filtered interactively. To do these it was paramount to Report connection by right clicking while your cursor is on a slicer and choosing "Report connection" , The slicers used were:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Price Category-it categorized data into High price, Low price and Medium Price.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Discount Category-it categorized data into High discount, Low discount, and Medium discount&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rating Category- that categorized data into average, excellent, poor and missing for missing values.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Charts were located beneath these slicers and used to communicate patterns in the data.&lt;br&gt;
The dashboard was designed to allow users to move from an overall view of product performance to more specific product-level analysis.&lt;/p&gt;

&lt;p&gt;Besides the chart I created a recommendation table that would inform the Jumia sellers. &lt;br&gt;
It is also important to note that when building a dashboard, Presentability and neatness are key, the colors used in the graphs, dashboard background and headings must be consistent.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Key Findings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;High-Engagement Products&lt;/strong&gt;&lt;br&gt;
The top 10 products by reviews accounted for 388 of the 723 total reviews, representing approximately 53.7% of all reviews in the dataset.&lt;br&gt;
The 120W Cordless Vacuum Cleaner had the highest review count with 69 reviews, followed by the 137 Pieces Cake Decorating Tool Set with 55 reviews.&lt;br&gt;
This shows that review engagement was concentrated among a relatively small group of products.&lt;br&gt;
&lt;strong&gt;Top-Rated Products&lt;/strong&gt;&lt;br&gt;
The top 10 products by rating had an average rating of 4.94/5.&lt;br&gt;
Seven of these products had a rating of 5.0, while the remaining three had ratings of 4.8.&lt;br&gt;
These products could provide useful benchmarks for understanding characteristics associated with positive customer experiences.&lt;br&gt;
&lt;strong&gt;Low-Rated Products&lt;/strong&gt;&lt;br&gt;
The bottom five products by rating had an average rating of 2.12/5, compared with the overall dataset average of 3.89/5.&lt;br&gt;
The lowest-rated product was the Wall-Mounted Sticker Punch-Free Plug Fixer, with a rating of 2.0/5.&lt;br&gt;
These products may require investigation before additional marketing or promotional resources are allocated to them.&lt;br&gt;
&lt;strong&gt;Highly Discounted Products&lt;/strong&gt;&lt;br&gt;
The top 10 products by discount had an average discount of 54%.&lt;br&gt;
The highest individual discount was 61%, recorded for the Pen Grips for Kids Pen Grip Posture Correction Tool for Kids.&lt;br&gt;
However, the relationship analysis showed that discount percentage had only a very weak relationship with reviews. Therefore, larger discounts should not automatically be assumed to produce stronger engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Screenshot of original data, cleaned data, pivot tables, and Dashboard.
&lt;/h2&gt;

&lt;p&gt;To to attach a face to our long article I have uploded the four most vital images that were generated in this analysis but most of all a view of the dashboard that was created.&lt;/p&gt;

&lt;p&gt;a) The original data&lt;br&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%2Fibmp4kljax9wfsm8e9i6.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%2Fibmp4kljax9wfsm8e9i6.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b) The Cleaned Data&lt;br&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%2Fqmebbv61xmry95w1o8el.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%2Fqmebbv61xmry95w1o8el.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;c) Pivot tables&lt;br&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%2Focf1evlz1bohyl606kz0.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%2Focf1evlz1bohyl606kz0.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;d) Dashboard&lt;br&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%2Favzglg6le7qhxvof4xni.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%2Favzglg6le7qhxvof4xni.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Business Recommendations
&lt;/h2&gt;

&lt;p&gt;Based on the analysis, several recommendations can be made.&lt;br&gt;
&lt;strong&gt;1. Prioritize High-Engagement Products&lt;/strong&gt;&lt;br&gt;
Since the top 10 products accounted for approximately 53.7% of all reviews, sellers could identify what these products have in common and prioritize similar products for visibility, promotion, and inventory planning.&lt;br&gt;
&lt;strong&gt;2. Test Targeted Discounts&lt;/strong&gt;&lt;br&gt;
Medium-discount products recorded the highest total reviews at 348. However, the correlation between discount and reviews was very weak.&lt;br&gt;
Rather than relying on large discounts across all products, sellers should test targeted promotional strategies and evaluate their results using multiple performance indicators.&lt;br&gt;
&lt;strong&gt;3. Investigate Low-Rated Products&lt;/strong&gt;&lt;br&gt;
Products with consistently low ratings should be investigated before receiving additional promotional investment.&lt;br&gt;
Possible areas for investigation include product quality, product descriptions, customer expectations, and fulfillment experience.&lt;br&gt;
&lt;strong&gt;4. Use Highly Rated Products as Benchmarks&lt;/strong&gt;The highest-rated products can be examined to identify practices that may contribute to positive customer experiences.&lt;br&gt;
These could include product quality, accurate descriptions, competitive pricing, and reliable fulfillment.&lt;br&gt;
&lt;strong&gt;5. Use Multiple Metrics for Decision-Making&lt;/strong&gt;&lt;br&gt;
Because the relationships between price, discount, rating, and reviews were weak, sellers should avoid relying on a single metric when making business decisions.&lt;br&gt;
A broader analysis incorporating sales, revenue, listing age, customer feedback, and other product-level factors would provide stronger evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Limitations
&lt;/h2&gt;

&lt;p&gt;This analysis has several limitations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No sales or revenue data: The dataset does not contain actual sales, revenue, profit, or conversion data. Reviews were therefore used only as a proxy for customer engagement.&lt;/li&gt;
&lt;li&gt;Missing ratings: 55 of the 112 products, or 49.1%, had no recorded rating. This limits rating-based comparisons.&lt;/li&gt;
&lt;li&gt;No listing-age information: The dataset does not indicate how long each product had been available. Older listings may naturally have more reviews.&lt;/li&gt;
&lt;li&gt;Correlation does not imply causation: The correlation analysis identifies relationships between variables but cannot establish that discounts, prices, or ratings directly cause changes in review engagement.&lt;/li&gt;
&lt;li&gt;Limited customer information: The dataset does not contain detailed review comments, product-quality measures, seller information, or delivery performance.&lt;/li&gt;
&lt;li&gt;Dataset size: The analysis covers 112 products and therefore should not automatically be generalized to every product on Jumia or the wider e-commerce market.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The Jumia Product Performance Dashboard transformed raw e-commerce product data into an interactive analytical tool covering 112 products.&lt;br&gt;
The analysis showed that discount, rating, and current price had only weak relationships with the available review data. At the product level, however, engagement was concentrated among a smaller group of products, while a separate group of products had notably low ratings.&lt;br&gt;
At the same time, the limitations of the dataset highlighted the importance of combining reviews with additional business information such as sales, revenue, listing age, and customer feedback. Additionally, the importance of having a good dashboard in a business was seen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Resources
&lt;/h2&gt;

&lt;p&gt;The complete project files are available in my GitHub repository and include original data, cleaned dataset, analysis, PivotTables, dashboard, and supporting documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository link&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/gee-999/JUMIA-PRODUCT-PERFORMANCE-PROJECT" rel="noopener noreferrer"&gt;https://github.com/gee-999/JUMIA-PRODUCT-PERFORMANCE-PROJECT&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dashboards</category>
      <category>pivottables</category>
      <category>data</category>
    </item>
    <item>
      <title>Getting Started with Excel for Data Analytics: From Basics to Data Cleaning.</title>
      <dc:creator>Gloria Adhiambo Awinja</dc:creator>
      <pubDate>Sun, 30 Aug 2026 20:26:55 +0000</pubDate>
      <link>https://dev.to/gloriaawinja/getting-started-with-excel-for-data-analytics-from-basics-to-data-cleaning-o52</link>
      <guid>https://dev.to/gloriaawinja/getting-started-with-excel-for-data-analytics-from-basics-to-data-cleaning-o52</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Microsoft Excel is an application that was developed by Microsoft as a tool for organizing information in rows and columns, performing calculations and presenting data. Overtime, excel has evolved into a powerful tool for data analysis.&lt;br&gt;
Data specialist adopted excel and begun using it for various purposes including data entry, cleaning, organizing, storing, calculating, and validating data among others.&lt;br&gt;
In this article we will be learning the basics of excel and data cleaning in the process of data analysis. We will use example to see how we can convert raw data into meaningful data that can be used to generate powerful insights.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;1.Understanding the Excel Interface&lt;br&gt;
2.Data Types&lt;br&gt;
3.Functions&lt;br&gt;
4.Data Analysis&lt;/p&gt;

&lt;h3&gt;
  
  
  i) Understanding the Excel Interface.
&lt;/h3&gt;

&lt;p&gt;The first time you open an excel &lt;strong&gt;worksheet&lt;/strong&gt; you will be met by a book like image with a toolbar panel at the top referred to as a &lt;strong&gt;ribbon&lt;/strong&gt;, beneath it on the left a bar referred to as a name box, and next to it is what is referred to as a &lt;strong&gt;formular bar&lt;/strong&gt;, at the center and what covers the main area is a &lt;strong&gt;worksheet&lt;/strong&gt; &lt;strong&gt;frame&lt;/strong&gt; with &lt;strong&gt;rows&lt;/strong&gt; and &lt;strong&gt;columns&lt;/strong&gt;, with each having a column and row header. The rows are numbered from 1 to 1,048,576 while the Columns are named from A to XFD.&lt;/p&gt;

&lt;p&gt;An example of a worksheet would be like the one bellow.&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%2Fofbo65y26bhrvdh0ehbl.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%2Fofbo65y26bhrvdh0ehbl.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The different parts of a worksheet are precisely named in the image 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%2Fhpg5xkeg53ft8rcojnz6.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%2Fhpg5xkeg53ft8rcojnz6.png" alt=" " width="621" height="657"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a better understanding we shall define the parts labelled in our image above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control Menu/Box&lt;/strong&gt;- Opens a menu with commands for controlling the Excel window, such as minimizing, maximizing, or closing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Access Toolbar&lt;/strong&gt;-Provides quick access to frequently used commands, such as Save, Undo, and Redo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ribbon&lt;/strong&gt;-The main area at the top of Excel that contains the different commands and tools used to work with a workbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ribbon Category/Tab&lt;/strong&gt;- Organizes Excel commands into different tabs, such as Home, Insert, Page Layout, Formulas, Data, and Review.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Title Bar&lt;/strong&gt;- it displays the name of the current workbook along with the name of the Excel program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Help Button&lt;/strong&gt;- Opens Excel's help and support features, allowing users to find information or guidance when needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Worksheet Frame&lt;/strong&gt;- This is the main part of the Excel window where the worksheet grid and its contents are displayed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select All Button&lt;/strong&gt;- Selects the entire worksheet at once, including all rows and columns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name Box&lt;/strong&gt;- Shows the location or name of the currently selected cell, such as A1. It can also be used to move quickly to a specific cell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Active Cell&lt;/strong&gt;-The cell that is currently selected and ready for data entry or editing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dialog Box Launcher&lt;/strong&gt;- A small button that opens a dialog box containing additional settings and options for a particular group of commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert Function Button (fx)&lt;/strong&gt;- Helps users find and insert functions into formulas without having to type the entire function manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Column Headings&lt;/strong&gt;- The letters at the top of the worksheet that identify each column, such as A, B, C, and D.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Row Headings&lt;/strong&gt;-The numbers along the left side of the worksheet that identify each row.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Formula Bar&lt;/strong&gt;- Displays the contents of the selected cell and allows users to enter or edit data, text, and formulas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Category Groups&lt;/strong&gt;- Groups related commands together on the Ribbon, making it easier to find and use the tools needed for a particular task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Worksheet Area-&lt;/strong&gt; The main grid made up of rows and columns where users enter, organize, and view their data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;workbook&lt;/strong&gt;- is an excel file that contains one or more worksheets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Split Boxes&lt;/strong&gt;- Divide the worksheet window into separate sections so that different parts of the worksheet can be viewed or scrolled at the same time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scroll Bars&lt;/strong&gt;- Allow users to move around the worksheet vertically or horizontally to view areas that are not currently visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sheet Tabs&lt;/strong&gt;- Allow users to switch between different worksheets within the same Excel workbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert Worksheet Button&lt;/strong&gt;-Adds a new worksheet to the current workbook, making it possible to organize information on separate sheets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Status Bar&lt;/strong&gt;-Located at the bottom of the Excel window and displays useful information about the current worksheet, selected cells, and other activities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View Buttons&lt;/strong&gt;-Allow users to change how the worksheet is displayed on the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Normal View&lt;/strong&gt;-The standard Excel view used for entering, editing, and working with data in a worksheet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Page Layout View&lt;/strong&gt;- Shows the worksheet in a format similar to how it will look when printed, including page boundaries and margins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Page Break Preview&lt;/strong&gt;- Shows where Excel will divide the worksheet into separate pages when the document is printed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zoom Slider&lt;/strong&gt;- Allows users to increase or decrease the size of the worksheet displayed on the screen, making it easier to view the data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Types
&lt;/h3&gt;

&lt;p&gt;Now having understood the excel interface we will look at the different data types catered for in the excel working space.&lt;br&gt;
They include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Numeric-data type that contains only numbers.&lt;/li&gt;
&lt;li&gt;Text-data types that contain text and strings&lt;/li&gt;
&lt;li&gt;Date-contains date which includes, days, months, and years.&lt;/li&gt;
&lt;li&gt;Time-contains the time&lt;/li&gt;
&lt;li&gt;Currency-contains the different currency like KES and $&lt;/li&gt;
&lt;li&gt;Boolean-refers to the data that generates TRUE and FALSE values.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;Functions refer to predefined formulas in excel that perform specific calculations.&lt;br&gt;
In our article today we are going to look at text, numeric, date and COUNT Functions used in excel.&lt;/p&gt;

&lt;h4&gt;
  
  
  a.)Text function
&lt;/h4&gt;

&lt;p&gt;In excel you will encounter text function like &lt;br&gt;
&lt;strong&gt;Upper function, Upper()&lt;/strong&gt;-is used to change a given text into uppercase.&lt;br&gt;
&lt;strong&gt;Lower function, Lower()&lt;/strong&gt;-is used to convert a given text into lowercase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proper function, Proper()&lt;/strong&gt;- is used to convert a given text into proper case E.g. Mary Ann&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Find function, Find()&lt;/strong&gt;-its a function that is used to find a certain text within another text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Left function, by Left()&lt;/strong&gt;-is used to extract a specified number of text to the left of a text string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Right function, right()&lt;/strong&gt;-is used to extract a specified number of text to the right of a txt string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Length function, Len()&lt;/strong&gt;-is  used to count the number of characters in a cell or text including spaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mid function, mid()&lt;/strong&gt;-extracts a specific number of characters from the middle of a string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONCAT function, CONCAT()&lt;/strong&gt;-it is used to combine text from two or more cells into one &lt;/p&gt;

&lt;h4&gt;
  
  
  b.) Numeric Functions and Operators
&lt;/h4&gt;

&lt;p&gt;Operators refer to symbols used in excel to perform calculations. &lt;br&gt;
These operators include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arithmetic Operators which involve:
i) Addition (+)
ii) Subtraction (-)
iii) multiplication (*)
iv) Division (/)
v) Exponent (^)&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  c.) Mathematical functions
&lt;/h4&gt;

&lt;p&gt;i) Power()&lt;br&gt;
ii) sqrt()&lt;/p&gt;

&lt;h4&gt;
  
  
  d.) Aggregate Functions
&lt;/h4&gt;

&lt;p&gt;In addition we have aggregate functions which can be used to work on a group or range of numbers and give one output.&lt;br&gt;
PRODUCT()&lt;br&gt;
MIN()&lt;br&gt;
MAX()&lt;br&gt;
MODE()&lt;br&gt;
MEDIAN()&lt;br&gt;
SUM()&lt;br&gt;
AVERAGE()&lt;/p&gt;

&lt;h4&gt;
  
  
  e.) Date Function
&lt;/h4&gt;

&lt;p&gt;These are functions used to create, extract, calculate, or manipulate dates and times in excel&lt;br&gt;
They include:&lt;br&gt;
TODAY()&lt;br&gt;
NOW()&lt;br&gt;
DAY()&lt;br&gt;
MONTH()&lt;br&gt;
YEAR()&lt;br&gt;
DATEDIF()&lt;br&gt;
NETWORK()&lt;/p&gt;

&lt;h4&gt;
  
  
  f.)Counting Functions
&lt;/h4&gt;

&lt;p&gt;These are functions that are used to count cells or values in a range.&lt;br&gt;
They include&lt;br&gt;
COUNT()&lt;br&gt;
COUNTA()&lt;br&gt;
COUNTBLANK()&lt;/p&gt;

&lt;h4&gt;
  
  
  e.)Conditional Aggregation Functions
&lt;/h4&gt;

&lt;p&gt;We also have another set of functions that are used to calculate or summarize data only when certain conditions are met.&lt;br&gt;
This functions can be used with both numerical and text data types. They include:&lt;br&gt;
SUMIF()&lt;br&gt;
SUMIFS()&lt;br&gt;
COUNTIF()&lt;br&gt;
COUNTIFS()&lt;br&gt;
AVERAGEIF()&lt;/p&gt;

&lt;h2&gt;
  
  
  Data analysis
&lt;/h2&gt;

&lt;p&gt;The process of analyzing data in excel begins with having data, then cleaning the data and ensuring each entry is in the correct order, and finally analyzing it to get answers to the questions at hand. We shall define some more labels that will be paramount in our journey to analysis our data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data cleaning&lt;/strong&gt;: This is the process of finding and correcting or removing inconsistencies in a dataset so that the data is accurate and ready for analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data validation&lt;/strong&gt;: refers to a feature that is in excel that controls the type of data that a user can enter into a cell, and if entered at a later time when we have our data it prevents entry of current data that is not coherent with the type of data specified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional Formatting&lt;/strong&gt; : this refers also to an excel feature that automatically changes the outlook of a cell when they meet a specified condition.&lt;br&gt;
&lt;strong&gt;Sorting&lt;/strong&gt;: these refers to arranging data in a particular order.&lt;br&gt;
sorting is unique for numeric, text, and date data types and custom filter where you use your own condition.&lt;br&gt;
In &lt;strong&gt;numeric Sorting&lt;/strong&gt; numbers are sorted from largest to smallest or smallest to largest&lt;br&gt;
In &lt;strong&gt;text sorting&lt;/strong&gt; sorting occurs either from A to Z or Z to A&lt;br&gt;
While  &lt;strong&gt;in date sorting&lt;/strong&gt; its done from oldest to newest or newest to oldest.&lt;br&gt;
Above that we have &lt;strong&gt;multilevel sorting&lt;/strong&gt; where we sort data using more than one criterion, one after another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filtering&lt;/strong&gt;: is the process of displaying only the data that meets specific conditions while temporarily hiding the other data.&lt;/p&gt;

&lt;p&gt;Just like sorting filtering depends on the data type, where we have &lt;strong&gt;text filters&lt;/strong&gt; having criterions like equals, does not equal, Begins with, Ends with, Contains, Does not contain, meanwhile &lt;strong&gt;number filters&lt;/strong&gt; have criterions like Equals, Does not Equal, greater than, less than, less than or Equal to, Between, Top 10 and&lt;br&gt;&lt;br&gt;
&lt;strong&gt;date filters&lt;/strong&gt; containing criterions like equals, before, after, Between, Today, Tomorrow, Yesterday, This week, Last week etc.&lt;br&gt;
&lt;strong&gt;custom filters&lt;/strong&gt; on the other hand is used where you use your own conditions.&lt;/p&gt;

&lt;p&gt;Now we shall look at an example that puts to practice every information that has been discussed in the article.&lt;/p&gt;

&lt;p&gt;Lets say we have a data called &lt;strong&gt;Nurses salary&lt;/strong&gt;. Our data contains different column entries including Nurses id, first name, last name, age, country, year of employment, salary and the type of shift each does.&lt;/p&gt;

&lt;p&gt;The image below shows a sample of the data we are working with. &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%2F1kp7nsfjygn7yqrwtxrt.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%2F1kp7nsfjygn7yqrwtxrt.png" alt=" " width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is important to note that before begin anything with your data you must have two worksheets, one which contains the original data, and the other named cleaned which you will be cleaning and carrying out your analysis&lt;/p&gt;

&lt;h2&gt;
  
  
  i) cleaning the data
&lt;/h2&gt;

&lt;p&gt;The first thing is to remove duplicates- Select your data range or press Ctrl + A to select the whole table. Go to the Data tab on the top ribbon. Click Remove Duplicates.&lt;/p&gt;

&lt;h4&gt;
  
  
  1.cleaning numeric data example
&lt;/h4&gt;

&lt;p&gt;Point to note in our data set is that the age column seems to have age appearing on the left side of the column instead of the right. All text appear on the left and numeric data to the right. Our data seems to have a problem with data type so we will go to Home-Number tab-select numeric&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%2F8zq1lrn4ua3ototec5lt.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%2F8zq1lrn4ua3ototec5lt.png" alt=" " width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after correction&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%2Fughnlvarlyy4dkfqbt4q.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%2Fughnlvarlyy4dkfqbt4q.png" alt=" " width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the salary column you will also note blanks, where there is no entry, for numeric we leave it like that.&lt;/p&gt;

&lt;h4&gt;
  
  
  2.Cleaning date example
&lt;/h4&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%2Fhr6cwv4gukxgrpipft21.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%2Fhr6cwv4gukxgrpipft21.png" alt=" " width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the first entry contains a different format of the date so we are required to change it into one format&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%2F3nszq8ajpo35szhg5b25.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%2F3nszq8ajpo35szhg5b25.png" alt=" " width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. An Example of cleaning Text Data
&lt;/h4&gt;

&lt;p&gt;Firstly, check if there are any blanks in text columns and convert them to unknown Using ctrl+H that enables you to find the blanks and replace them.&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%2Fr6uue5grunuj0u6sn6ou.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%2Fr6uue5grunuj0u6sn6ou.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then click on replace all &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%2Fny1mrascj1zv6mfe4dg9.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%2Fny1mrascj1zv6mfe4dg9.png" alt=" " width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The text data my contain text not written in proper format like names.&lt;br&gt;
for example look at our screenshot below.&lt;br&gt;
we are required to right click in the columns header-insert column, and use the function Proper to change the names into proper format.&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%2F7oc474mqtz0405a84d44.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%2F7oc474mqtz0405a84d44.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&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%2F8z0q291fnv57uax30vi5.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%2F8z0q291fnv57uax30vi5.png" alt=" " width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;create yet another final column that you will copy the entries from the column first name p to, to avoid having reference errors when the column first name is tampered with.&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%2F66oh1kolrp0enav5ekr2.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%2F66oh1kolrp0enav5ekr2.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;delete the other columns and remain with the last created column named first name proper.&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%2Fbowr0fb1py1jx3gld1zm.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%2Fbowr0fb1py1jx3gld1zm.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Excel provides a simple and practical starting point for data analytics because it allows users to organize, examine, clean, and prepare data within a single application. Understanding basic concepts such as rows, columns, cells, cell references, formulas, and functions creates a strong foundation for working with datasets. Through the practical dataset used in this article, it has been demonstrated that Excel can be used to identify and correct common data-quality problems such as missing values, duplicate records, inconsistent text entries, and incorrect data formats. Features such as sorting, filtering, tables, and functions make the cleaning process more efficient and help ensure that the resulting dataset is accurate and consistent. Overall, data cleaning is an important step in the data analytics process because the quality of analysis depends largely on the quality of the data being analyzed. By mastering these basic Excel skills, beginners can confidently move from raw data to a clean, structured dataset that is ready for further analysis and visualization.&lt;/p&gt;

</description>
      <category>excelbasics</category>
      <category>cleaninginexcel</category>
    </item>
    <item>
      <title>PUSHING A LOCAL FOLDER TO GITHUB USING GIT AND SSH.</title>
      <dc:creator>Gloria Adhiambo Awinja</dc:creator>
      <pubDate>Sat, 22 Aug 2026 21:30:01 +0000</pubDate>
      <link>https://dev.to/gloriaawinja/pushing-a-local-folder-to-github-using-git-and-ssh-3j18</link>
      <guid>https://dev.to/gloriaawinja/pushing-a-local-folder-to-github-using-git-and-ssh-3j18</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;As a beginner in the data industry it is paramount to understand that projects are often created and stored locally on a computer before being shared or backed up online. Therefore, the first step into the journey of a data specialist becomes to learn the simplest yet most important thing: How to transfer these folders or files in your local PC into GitHub. This article will show you how to transfer locally created directory to GitHub using Git and a SSH key.&lt;br&gt;
Git Bash commonly known as Git is a tool installed on your computer that tracks and manages changes made to your projects' files and folders. GitHub on the other hand, is an online platform where you can store your Git projects. The platform enables you to access, share, and collaborate on the project from anywhere. Meanwhile, an SSH key is a secure digital key that allows your computer to connect to your GitHub account without repeatedly entering a password. &lt;br&gt;
In this article I will show you how to create or access your local folders and files using git and transfer them to a GitHub platform with the use of a SSH key.&lt;/p&gt;
&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;The article will contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How to create a local Directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Initializing Git&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding Local Directories to the Staging Area&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Committing the Project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connecting the Local Repository to a Remote Repository&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understanding the SSH KEY&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pushing the Project to GitHub Using a SSH key&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  A. Creating a Local Directory
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Steps to Creating a Local Directory.
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;NB&lt;/strong&gt;: We will use Sales Project as an example of our project directory.&lt;/p&gt;

&lt;p&gt;The first step in creating your local project directory is to check your current working directory. This is done by opening the Git terminal and  writing the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;pwd&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This command simply asks, where am I right now?&lt;/p&gt;

&lt;p&gt;After knowing where you are, you can now create a project directory in the location you are currently in or open a new location you would like the directory to appear.&lt;/p&gt;

&lt;p&gt;Lets say we want to create a directory called Sales Project, and we would like it to be located in the Desktop directory. What we require is to open the desktop directory and create our sales project directory there. &lt;br&gt;
To open the Desktop Directory we use a command &lt;strong&gt;&lt;code&gt;cd&lt;/code&gt;&lt;/strong&gt; which allows us to enter into a directory of our choice as long as the directory exists in our local PC. So our code would be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;cd Desktop&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, having opened the desktop folder, we want to create our sales project directory. To create a folder we are required to use the command &lt;strong&gt;&lt;code&gt;mkdir&lt;/code&gt;&lt;/strong&gt;.The code appears as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkdir "sales Project"&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, when you check your Desktop, you should be able to see a folder called Sales Project.&lt;/p&gt;

&lt;p&gt;You can also check for the presence of the folder by using &lt;strong&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt; under the directory Desktop. &lt;strong&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt; is simply a command we use to show the files and folders in your current location.&lt;/p&gt;

&lt;p&gt;After creating our sales project directory we are required to create a README.md file. A README.md file is a document that is created using markdown language and is used to explain what the project is about, the tools used, how it works, and other important information concerning the project. It helps users understand a project without having to read the code.&lt;/p&gt;

&lt;p&gt;To create it we use the command &lt;strong&gt;&lt;code&gt;touch&lt;/code&gt;&lt;/strong&gt; , the code appears as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;touch README.md&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Afterwards we can create a folder That will contain all the data used in the project in question. For example our data could entail excel files, screenshots and pictures. Lets say our folder is called DATA, then we will have to create it by coding:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkdir DATA&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With these steps we would have successfully created our folder called Sales Project, which contains a README.md file and a folder where we can place the data we are working on called DATA. So in summary the codes of creating this directory in our PC would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd
cd &lt;/span&gt;Desktop
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="s2"&gt;"Sales Project"&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;Sales Project
&lt;span class="nb"&gt;touch &lt;/span&gt;README.md
&lt;span class="nb"&gt;mkdir &lt;/span&gt;DATA

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  B. Initializing Git
&lt;/h2&gt;

&lt;p&gt;When we say Git initialization we refer to the process of enabling Git to start tracking a particular folder as a Git repository.&lt;br&gt;
In our example, when we initialize git we are enabling the ordinary directory we called Sales Project to be turned into a git repository where changes made to it can be tracked.&lt;br&gt;
To enable this we use the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  c. Adding Files to the Staging Area
&lt;/h2&gt;

&lt;p&gt;After initializing, we are required to tell Git which changes we want to include in our next commit. For this to be possible we use the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now depending on the changes in the directory you want to stage you will use different ways to initialize. For instance, if you want to add everything in the directory and its subdirectories to the staging area we use the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;if you want to select specific changes then you select the specific areas you want to add to the staging area. For example, we want to add the changes in the README.md file alone we will initiate a:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add README.md&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;if we need changes committed in the DATA folder only we will have:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git add DATA/&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  D. Committing the Project
&lt;/h2&gt;

&lt;p&gt;A commit refers to a saved checkpoint of the project. It records the changes that you had prepared in the staging area. &lt;br&gt;
The command used to commit is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git commit -m " what you are committing"&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The message inside the quotation marks describes what the commit contains and helps in understanding the project later.&lt;br&gt;
taking the example of our project we could write&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git commit -m "Sales project"&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  E. Connecting the Local Repository
&lt;/h2&gt;

&lt;p&gt;After committing we are now required to create a repository on GitHub. GitHub, acts as a remote location where we can store and access the project online. &lt;/p&gt;

&lt;p&gt;The remote repository can be given a name , and a description, and it will generate a SSH key URL which will be used in connecting the local repository to GitHub. The command used will be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git remote add origin&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here &lt;strong&gt;origin&lt;/strong&gt; means the name given to GitHub repository connected to the local project. If we use the example of our project the command would appear as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin git@github.com:username/repository.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;with the URL written after origin being an SSH remote URL that connects the local Git repository to the GitHub repository.   &lt;/p&gt;
&lt;h1&gt;
  
  
  Understanding the SSH KEY
&lt;/h1&gt;

&lt;p&gt;To connect your local Git repository to GitHub securely, you require a key called the secure shell key or commonly called the SSH key. &lt;br&gt;
It is generated and obtained after you have configured the Git Bash, the key is generated using the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ssh-keygen -t ed25519 -C "Your email@example.com"&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consequently, Git bash will ask you to enter a passphrase twice for the purpose of confirmation. Then it will generate a private key and a public key, which helps us to connect the local Git repository to GitHub securely.&lt;br&gt;
For safety purposes we will use the public key written with &lt;strong&gt;.pub&lt;/strong&gt; which stands for public.&lt;/p&gt;

&lt;p&gt;The command&lt;br&gt;
&lt;strong&gt;&lt;code&gt;cat ~/.ssh/id_ed25519.pub|clip&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;shows us how to copy and clip the key.&lt;/p&gt;

&lt;p&gt;After acquiring this public key we are required to go to the GitHub account, and open settings then click SSH key, then New SSH Key and add the SSH key there.&lt;/p&gt;

&lt;p&gt;Afterwards return to Git Bash and test the connection using the command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ssh -T git@github.com&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the connection is successful, we now know we will be able to connect the local repository with the remote repository using the command;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin git@github.com:username/repository.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Allowing GitHub to verify that the computer is authorized to access the repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  F. Pushing the Project to GitHub
&lt;/h2&gt;

&lt;p&gt;After connecting the project to GitHub, check what your branch is called using the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A branch in this context refers to a separate version of Git project that allows you to make changes without directly affecting the main branch. Meanwhile, the main branch is the primary branch of a Git repository which contains the main, stable version of your project.&lt;/p&gt;

&lt;p&gt;Its important that the local branch and remote branch you are  pushing to match. In the past the branch was commonly referred to as &lt;strong&gt;master&lt;/strong&gt; but with time the modern GitHub default branch evolved and begun to be called &lt;strong&gt;main&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So for instance if your default branch is master and your remote branch was created as main you will be required to change it to main and hence, use the command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git branch -M main&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This changes your branch to main. &lt;/p&gt;

&lt;p&gt;Now after dealing with the branch, the next step is to push the project and it is done using the command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push -u origin main&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
or &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git push -u origin master&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;depending with what your remote repository is called. After pushing your project successfully, the repository will appear in your GitHub account marking the end of the process of creating and pushing a directory to become a repository from the local PC to a remote GitHub repository.&lt;/p&gt;

&lt;p&gt;This image shows the steps of pushing a local directory to GitHub using git.&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%2Fo2o9o7ejdv7rtjj25pqg.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%2Fo2o9o7ejdv7rtjj25pqg.png" alt=" " width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets have a code example showing the flow of events in the process of pushing a locally created directory to GitHub using the SSH key:&lt;/p&gt;

&lt;p&gt;&lt;u&gt;example&lt;/u&gt;&lt;br&gt;
Lets consider that we already set up our SSH key and we want to push a locally generated project from the git bash to GitHub using the SSH key.&lt;br&gt;
While using our example of Sales Project as our directory, this is how the flow of creating a directory and pushing it would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="nb"&gt;pwd 
cd &lt;/span&gt;Desktop
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="s2"&gt;"Sales Project"&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"Sales Project"&lt;/span&gt;
&lt;span class="nb"&gt;touch &lt;/span&gt;README.md
&lt;span class="nb"&gt;mkdir &lt;/span&gt;DATA
&lt;span class="nb"&gt;cd&lt;/span&gt; .. &lt;span class="c"&gt;##this allows you to go a step back from current directory.&lt;/span&gt;
     &lt;span class="c"&gt;## this one for instance will take you back to README.md&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"sales"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;README.md &lt;span class="c"&gt;# enables writing text into a file&lt;/span&gt;
&lt;span class="nb"&gt;cat &lt;/span&gt;README.md &lt;span class="c"&gt;# displays contents of a file in the terminal&lt;/span&gt;
nano README.md &lt;span class="c"&gt;# enables editing of README.md file&lt;/span&gt;
git init
git status &lt;span class="c"&gt;##Helps check what is happening in your git project&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;  
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Sales Project"&lt;/span&gt;
git remote add origin git@github.com:username/repository.git                                                   
git branch
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;In conclusion, moving a project from a local computer to GitHub involves a clear sequence of steps which involve creating and initializing the repository, staging and committing changes, establishing an SSH connection, linking the local repository to a remote repository, and pushing the committed work to GitHub. Each stage serving a specific purpose in maintaining a reliable version-controlled project. Understanding this workflow provides a practical foundation for managing  projects, tracking changes, and collaborating through Git and GitHub.&lt;/p&gt;

</description>
      <category>firstgithubproject</category>
      <category>pushinglocaldirectory</category>
    </item>
  </channel>
</rss>
