<?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>Forem: David</title>
    <description>The latest articles on Forem by David (@davi__mungai).</description>
    <link>https://forem.com/davi__mungai</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F601425%2F691bd8c0-8f74-4ddc-964a-483b674acec1.png</url>
      <title>Forem: David</title>
      <link>https://forem.com/davi__mungai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/davi__mungai"/>
    <language>en</language>
    <item>
      <title>Connecting Power BI to a PostgreSQL Database (Local &amp; Cloud-Aiven)</title>
      <dc:creator>David</dc:creator>
      <pubDate>Wed, 18 Mar 2026 09:52:01 +0000</pubDate>
      <link>https://forem.com/davi__mungai/connecting-power-bi-to-a-postgresql-database-local-cloud-aiven-40g6</link>
      <guid>https://forem.com/davi__mungai/connecting-power-bi-to-a-postgresql-database-local-cloud-aiven-40g6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Power BI is a powerful business intelligence (BI) tool developed by Microsoft that allows users to analyze data and build interactive dashboards. It is widely used by organizations to transform raw data into meaningful insights for decision-making.&lt;/p&gt;

&lt;p&gt;Most companies store their data in SQL databases such as PostgreSQL because they are efficient, reliable, and scalable. These databases allow structured storage of data in tables and support complex queries for analysis.&lt;/p&gt;

&lt;p&gt;By connecting Power BI to a SQL database, analysts can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access real-time data&lt;/li&gt;
&lt;li&gt;Perform advanced analysis&lt;/li&gt;
&lt;li&gt;Build automated dashboards&lt;/li&gt;
&lt;li&gt;Eliminate manual data entry&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Connecting Power BI to a Local PostgreSQL Database
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2Fp4vs9n0apedcltp361ft.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.amazonaws.com%2Fuploads%2Farticles%2Fp4vs9n0apedcltp361ft.PNG" alt="PostgreSQL connection screen" width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open Power BI Desktop
&lt;/h3&gt;

&lt;p&gt;Launch Power BI Desktop and click &lt;strong&gt;Get Data&lt;/strong&gt; from the Home tab.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 2: Choose PostgreSQL Database
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;PostgreSQL database&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Connect&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 3: Enter Connection Details
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; &lt;code&gt;localhost&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; &lt;code&gt;assignment&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Import mode&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;OK&lt;/strong&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fws2zg2wjzvmnxto8mt8x.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.amazonaws.com%2Fuploads%2Farticles%2Fws2zg2wjzvmnxto8mt8x.PNG" alt="Enter PostgreSQL connection details" width="743" height="442"&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.amazonaws.com%2Fuploads%2Farticles%2Fsh7e5h9vn5obidj52li0.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.amazonaws.com%2Fuploads%2Farticles%2Fsh7e5h9vn5obidj52li0.PNG" alt="Power BI Get Data menu showing PostgreSQL option" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: View Available Tables
&lt;/h3&gt;

&lt;p&gt;Power BI will display all tables in the database.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 5: Load Tables
&lt;/h3&gt;

&lt;p&gt;Select the following tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customers&lt;/li&gt;
&lt;li&gt;products&lt;/li&gt;
&lt;li&gt;sales&lt;/li&gt;
&lt;li&gt;inventory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Load&lt;/strong&gt; to import 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.amazonaws.com%2Fuploads%2Farticles%2Flihcru6jko8ktfxiv28f.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.amazonaws.com%2Fuploads%2Farticles%2Flihcru6jko8ktfxiv28f.PNG" alt="Load image for importing" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Connecting Power BI to Aiven PostgreSQL (Cloud)
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2F9zcydpomce55ho8svunj.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.amazonaws.com%2Fuploads%2Farticles%2F9zcydpomce55ho8svunj.PNG" alt="Aiven connection setup" width="800" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Get Connection Details from Aiven
&lt;/h3&gt;

&lt;p&gt;From your Aiven dashboard, obtain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Host&lt;/li&gt;
&lt;li&gt;Port&lt;/li&gt;
&lt;li&gt;Database name&lt;/li&gt;
&lt;li&gt;Username&lt;/li&gt;
&lt;li&gt;Password&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.amazonaws.com%2Fuploads%2Farticles%2F4icq9fxsxmv8z0kcuutj.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.amazonaws.com%2Fuploads%2Farticles%2F4icq9fxsxmv8z0kcuutj.PNG" alt="Connecting to Aiven PostgreSQL" width="800" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Connect in Power BI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enter the host instead of localhost&lt;/li&gt;
&lt;li&gt;Provide credentials&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Installing SSL Certificate (Required for Cloud Connection)
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2F3922lxovcpw4h6zkuk41.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.amazonaws.com%2Fuploads%2Farticles%2F3922lxovcpw4h6zkuk41.PNG" alt="Open certificate" width="430" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Download and Open Certificate
&lt;/h3&gt;

&lt;p&gt;Aiven provides an SSL certificate (&lt;code&gt;.crt&lt;/code&gt;) to secure the connection.&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.amazonaws.com%2Fuploads%2Farticles%2F07bye18936vfq172kn58.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.amazonaws.com%2Fuploads%2Farticles%2F07bye18936vfq172kn58.PNG" alt="Install certificate wizard" width="558" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Install Certificate
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Choose &lt;strong&gt;Local Machine&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 5: Choose Certificate Store
&lt;/h3&gt;

&lt;p&gt;Select:&lt;br&gt;
&lt;strong&gt;Trusted Root Certification Authorities&lt;/strong&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.amazonaws.com%2Fuploads%2Farticles%2Fxdwqh0ue6bafb044ga1h.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.amazonaws.com%2Fuploads%2Farticles%2Fxdwqh0ue6bafb044ga1h.PNG" alt="Select certificate store" width="552" height="583"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 6: Complete Installation
&lt;/h3&gt;

&lt;p&gt;Click &lt;strong&gt;Finish&lt;/strong&gt; to install the certificate.&lt;/p&gt;

&lt;h2&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.amazonaws.com%2Fuploads%2Farticles%2F21iq2fongj01w92amycq.PNG" alt="Finish certificate installation" width="563" height="545"&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why SSL is Important
&lt;/h3&gt;

&lt;p&gt;SSL certificates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encrypt data during transmission&lt;/li&gt;
&lt;li&gt;Protect against unauthorized access&lt;/li&gt;
&lt;li&gt;Ensure secure database connections&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Creating Relationships in Power BI
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2Fb98h0uxlxay5rrpz57r1.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.amazonaws.com%2Fuploads%2Farticles%2Fb98h0uxlxay5rrpz57r1.PNG" alt="Model view relationships" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After loading the tables, go to &lt;strong&gt;Model View&lt;/strong&gt; in Power BI.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relationships Created:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;customers.customer_id → sales.customer_id&lt;/li&gt;
&lt;li&gt;products.product_id → sales.product_id&lt;/li&gt;
&lt;li&gt;products.product_id → inventory.product_id&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What is Data Modeling?
&lt;/h3&gt;

&lt;p&gt;Data modeling is the process of defining relationships between tables so Power BI understands how data is connected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Relationships Matter:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enable accurate calculations&lt;/li&gt;
&lt;li&gt;Allow filtering across tables&lt;/li&gt;
&lt;li&gt;Prevent incorrect aggregations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Power BI Dashboard
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2F0w6qow6yeocr0t7dezcv.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.amazonaws.com%2Fuploads%2Farticles%2F0w6qow6yeocr0t7dezcv.PNG" alt="Dashboard overview" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the loaded data, a dashboard was created with the following visuals:&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Total Sales (Card)&lt;/li&gt;
&lt;li&gt;Sales trends&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Sales by product&lt;/li&gt;
&lt;li&gt;Sales by category&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Customer Insights
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sales per customer&lt;/li&gt;
&lt;li&gt;Top customers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Inventory Insights
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Stock levels per product&lt;/li&gt;
&lt;li&gt;Inventory comparison&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion: Why SQL is Important for Power BI
&lt;/h2&gt;

&lt;p&gt;SQL is an essential skill for Power BI analysts because it allows them to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieve data using &lt;code&gt;SELECT&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Filter data using &lt;code&gt;WHERE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Aggregate data using &lt;code&gt;SUM&lt;/code&gt;, &lt;code&gt;COUNT&lt;/code&gt;, &lt;code&gt;AVG&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Combine tables using &lt;code&gt;JOIN&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With SQL, analysts can prepare clean and efficient datasets before visualizing them in Power BI.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Connecting Power BI to PostgreSQL (both local and cloud) allows for powerful data analysis and real-time insights. By combining SQL knowledge with Power BI visualization capabilities, analysts can build meaningful dashboards that support better business decisions.&lt;/p&gt;

</description>
      <category>database</category>
      <category>microsoft</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Joins and Window Functions</title>
      <dc:creator>David</dc:creator>
      <pubDate>Mon, 02 Mar 2026 19:11:41 +0000</pubDate>
      <link>https://forem.com/davi__mungai/mastering-sql-a-guide-to-joins-and-window-functions-48bn</link>
      <guid>https://forem.com/davi__mungai/mastering-sql-a-guide-to-joins-and-window-functions-48bn</guid>
      <description>&lt;p&gt;In the world of data analytics, SQL is the essential language for extracting insights from relational databases. While basic queries (&lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;WHERE&lt;/code&gt;) are straightforward, the true power of SQL lies in manipulating and analyzing complex data relationships. This is where &lt;strong&gt;Joins&lt;/strong&gt; and &lt;strong&gt;Window Functions&lt;/strong&gt; become indispensable tools.&lt;/p&gt;

&lt;p&gt;Understanding these two concepts separates beginners from advanced SQL users. Joins help you connect different datasets, while Window Functions allow you to analyze data within those datasets without losing detail.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. SQL Joins: Combining Data Across Tables
&lt;/h2&gt;

&lt;p&gt;Relational databases are structured into multiple, smaller tables to prevent data repetition (normalization). For example, a &lt;strong&gt;customers&lt;/strong&gt; table and an &lt;strong&gt;orders&lt;/strong&gt; table are kept separate. Joins enable you to combine these tables based on a related column, usually a &lt;strong&gt;Primary Key–Foreign Key&lt;/strong&gt; relationship such as &lt;code&gt;customers.customer_id = orders.customer_id&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Join Types
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;INNER JOIN&lt;/strong&gt;&lt;br&gt;
Returns only the rows where there is a match in both tables.&lt;br&gt;
This is used for finding valid, connected data (for example, all orders that belong to a customer).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;LEFT JOIN (LEFT OUTER JOIN)&lt;/strong&gt;&lt;br&gt;
Returns all rows from the left table, and matched rows from the right table.&lt;br&gt;
If no match exists, the right side will contain &lt;code&gt;NULL&lt;/code&gt; values.&lt;br&gt;
Ideal for keeping your main list intact (for example, all customers, even those who have not placed an order).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;RIGHT JOIN&lt;/strong&gt;&lt;br&gt;
The opposite of a LEFT JOIN; it keeps all rows from the right table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;RIGHT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;FULL OUTER JOIN&lt;/strong&gt;&lt;br&gt;
Returns all rows when there is a match in either table.&lt;br&gt;
It combines the results of both LEFT and RIGHT joins.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;FULL&lt;/span&gt; &lt;span class="k"&gt;OUTER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Window Functions: Context-Aware Analytics
&lt;/h2&gt;

&lt;p&gt;Window functions perform calculations across a set of table rows that are related to the current row. Unlike &lt;code&gt;GROUP BY&lt;/code&gt;, which collapses rows into a single summary row, window functions keep individual rows intact while adding a calculated column.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Syntax: &lt;code&gt;OVER()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;OVER()&lt;/code&gt; clause defines the "window" or subset of data that the function operates on.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PARTITION BY&lt;/strong&gt; → Divides the rows into groups&lt;br&gt;
Example: &lt;code&gt;PARTITION BY customer_id&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ORDER BY&lt;/strong&gt; → Orders the rows within each partition&lt;br&gt;
Example: &lt;code&gt;ORDER BY amount DESC&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Common Window Functions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Ranking Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ROW_NUMBER()&lt;/code&gt; → Assigns a unique number&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;RANK()&lt;/code&gt; → Assigns rank, skips numbers on ties&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DENSE_RANK()&lt;/code&gt; → Assigns rank without skipping numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: Rank orders from highest to lowest amount.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;RANK&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;amount_rank&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Aggregation Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SUM()&lt;/code&gt;, &lt;code&gt;AVG()&lt;/code&gt;, &lt;code&gt;COUNT()&lt;/code&gt;, &lt;code&gt;MAX()&lt;/code&gt;, &lt;code&gt;MIN()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: Running total of order amounts over time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;order_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;running_total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Value Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;LAG()&lt;/code&gt; → Accesses data from a previous row&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LEAD()&lt;/code&gt; → Accesses data from a following row&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: Compare each order with the previous one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;LAG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;previous_amount&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Combining Joins and Window Functions
&lt;/h2&gt;

&lt;p&gt;In analytics, you often join tables first to get a complete picture, and then apply window functions to analyze trends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; List all orders with customer names, and rank orders by amount within each customer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;RANK&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;
        &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;order_rank&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Joins are used to connect two or more tables in a relational database, allowing you to bring related data together from different sources. Because joins combine datasets, they can change the number of rows in the result, either expanding or reducing them depending on the type of join used. They rely on keywords such as &lt;code&gt;JOIN&lt;/code&gt; and &lt;code&gt;ON&lt;/code&gt; to define how tables relate. Window functions, on the other hand, perform calculations over a set of rows within a single result set without collapsing those rows. Unlike joins, they preserve the original row count while adding computed values like running totals, rankings, or moving averages. They are defined using the &lt;code&gt;OVER()&lt;/code&gt; clause, often with &lt;code&gt;PARTITION BY&lt;/code&gt; to group related rows for analysis.&lt;/p&gt;




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

&lt;p&gt;By mastering both Joins and Window Functions, one can transform scattered, raw data into meaningful, actionable insights, often without needing complex, multi-step subqueries. These tools are foundational for anyone working in data analytics, backend development, or database administration.&lt;/p&gt;

&lt;p&gt;If the aim is to move from intermediate to advanced SQL, this is one of the most valuable skill combinations you can learn.&lt;/p&gt;

</description>
      <category>data</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Analysts Translate Messy Data, DAX, and Dashboards into Action Using Power BI</title>
      <dc:creator>David</dc:creator>
      <pubDate>Mon, 09 Feb 2026 14:06:03 +0000</pubDate>
      <link>https://forem.com/davi__mungai/how-analysts-translate-messy-data-dax-and-dashboards-into-action-using-power-bi-3b58</link>
      <guid>https://forem.com/davi__mungai/how-analysts-translate-messy-data-dax-and-dashboards-into-action-using-power-bi-3b58</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the world of business analytics, Power BI has become the bridge between overwhelming data chaos and decisive action. &lt;/p&gt;

&lt;p&gt;As one who is still learning and spending some time learning Power BI, I've discovered that analytics is fundamentally about translation: converting raw data into the language of business decisions. This article explores how analysts use Power BI's technical capabilities data transformation, data modeling, and DAX to create dashboards that help inform business decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Reality of Raw Data
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Messy Data Problem
&lt;/h3&gt;

&lt;p&gt;When you first connect to a real world dataset one expects clean, structured information ready for analysis. Instead, you find dates formatted as text, customer names spelled inconsistently, empty cells scattered randomly, and mislabeled columns with zero documentation. This data isn't bad per say lets call it raw data, and handling it is the analyst's first critical responsibility.&lt;/p&gt;

&lt;p&gt;According to industry research, data scientists spend approximately 80% of their time on data preparation and cleaning rather than actual analysis. Without proper data cleaning, every subsequent analysis,DAX calculation,and dashboard visualization becomes unreliable. &lt;a href="https://www.pragmaticinstitute.com/resources/articles/data/overcoming-the-80-20-rule-in-data-science/" rel="noopener noreferrer"&gt;pragmatic.institute&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Technical Skills Must Translate to Business Context
&lt;/h3&gt;

&lt;p&gt;The gap between technical capability and business impact is where many analytics projects fail.Power BI's strength lies in its ability to facilitate this translation process systematically through its workflow: clean data → structure relationships → define measures → communicate insights. &lt;/p&gt;

&lt;h2&gt;
  
  
  Data Transformation
&lt;/h2&gt;

&lt;p&gt;Data transformation is where analysts systematically convert unreliable source data into analysis ready datasets. When a healthcare organization uses Power BI to consolidate data across verticals, proper data cleaning reduces the time to access critical information from days to less than 24 hours. This responsiveness directly translates to better patient care decisions and operational agility. &lt;/p&gt;

&lt;p&gt;Also consider a retail scenario where if your dataset contains "Nairobi," "NBO," "nairobi," and "NRB" as separate categories,  sales analysis will incorrectly show four different locations. This leads to confusion, incorrect inventory decisions, and lost revenue. Power BI's transformation capabilities solve these fundamental issues before they contaminate downstream analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Modeling
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Architecture of Relationships
&lt;/h3&gt;

&lt;p&gt;After cleaning, the next translation step involves data modeling which involves structuring how tables relate to each other so Power BI can filter and calculate correctly. This requires understanding two core concepts: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact tables&lt;/strong&gt;: Stores measurable event/transaction data (numeric values) at a specific grain. These tables typically contain many rows representing individual events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dimension tables&lt;/strong&gt;: Provide descriptive context around those events : customer details, product information, date hierarchies, or location data. These tables describe the "who, what, when, where" of your facts. &lt;/p&gt;

&lt;p&gt;By establishing clear one-to-many relationships (one customer has many purchases, one product appears in many transactions), Power BI can respond correctly to user interactions and produce accurate aggregations. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why Model Design Determines Dashboard Success
&lt;/h3&gt;

&lt;p&gt;A well designed data model operates invisibly : users simply interact with slicers and filters, and everything works as expected. Poor modeling, however, creates obvious problems: slicers that don't affect all visuals, incorrect totals, or filters that produce confusing results. &lt;/p&gt;

&lt;p&gt;Organizations that implement proper star or snowflake schema designs in Power BI see dramatic improvements in report performance and user satisfaction. The technical modeling work translates directly into business users' ability to explore data independently and make decisions without constantly requesting new reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  DAX
&lt;/h2&gt;

&lt;p&gt;DAX is a collection of functions, operators, and constants that can be used in a formula, or expression, to calculate and return one or more values. While it appears to be a technical formula language, DAX is fundamentally about defining meaning in business terms. &lt;/p&gt;

&lt;p&gt;When creating a "Total Revenue" measure, the analyst must answer business questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Should this include or exclude returns?&lt;/li&gt;
&lt;li&gt;How do we handle partial refunds?&lt;/li&gt;
&lt;li&gt;Do we account for discounts before or after tax?&lt;/li&gt;
&lt;li&gt;How should this number respond when users filter by region or time period?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These business logic questions that DAX translates into executable code.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Operational Efficiency Impact
&lt;/h3&gt;

&lt;p&gt;DAX measures enhance operational efficiency by enabling real-time data analysis and automating complex calculations. For example, a retail company using DAX measures can dynamically monitor inventory levels and adjust stock based on real-time sales trends. Key performance indicators defined through DAX such as monthly revenue growth, profit margins, customer acquisition costs, and inventory turnover provide immediate insights into business performance.&lt;/p&gt;

&lt;p&gt;Organizations that effectively implement DAX measures report significant improvements in decision making speed and accuracy. The translation from raw data to actionable KPIs happens automatically as new data flows into the system, enables responding swiftly to market changes. &lt;/p&gt;

&lt;h2&gt;
  
  
  Dashboards
&lt;/h2&gt;

&lt;p&gt;Only after data is cleaned, modeled, and measured do dashboards truly matter.&lt;br&gt;
Best practices include highlighting key metrics prominently, showing trends rather than isolated values, enabling exploration through interactivity, and maintaining focus and clarity. &lt;/p&gt;

&lt;h3&gt;
  
  
  Real- World Dashboard Impact
&lt;/h3&gt;

&lt;p&gt;When properly designed, Power BI dashboards deliver measurable ROI.&lt;br&gt;
In retail organizations using Power BI dashboards for inventory management have reduced stockouts and overstock situations by accurately forecasting demand. Marketing teams tailor campaigns to specific customer segments identified through dashboard analytics, enhancing customer satisfaction and boosting sales. &lt;/p&gt;

&lt;h2&gt;
  
  
  Thinking Beyond Tools
&lt;/h2&gt;

&lt;p&gt;Learning Power BI teaches a fundamental lesson: data analysis is not about tools ,it's about thinking. Power BI simply provides the environment where analysts translate messy data through transformation, structure it through modeling, define meaning using DAX, and communicate insights through dashboards.&lt;/p&gt;

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

&lt;p&gt;The journey from messy data to business action requires systematic translation through Power BI's workflow. Data transformation converts chaotic source data into clean datasets. Data modeling establishes the logical relationships that enable correct filtering and aggregation. DAX measures define business metrics that respond dynamically to user questions. Dashboards communicate insights in visual forms that spark decisions and action.&lt;/p&gt;

&lt;p&gt;For analysts, mastering Power BI means developing the ability to think  simultaneously about the technical language of data structures, transformations, and calculations, and the business language of decisions, outcomes, and impact.&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>powerbi</category>
    </item>
    <item>
      <title>Schemas and Data Modelling in Power B.I</title>
      <dc:creator>David</dc:creator>
      <pubDate>Mon, 02 Feb 2026 17:09:40 +0000</pubDate>
      <link>https://forem.com/davi__mungai/schemas-and-data-modelling-in-power-bi-36h1</link>
      <guid>https://forem.com/davi__mungai/schemas-and-data-modelling-in-power-bi-36h1</guid>
      <description>&lt;h1&gt;
  
  
  Data modeling
&lt;/h1&gt;

&lt;p&gt;is the architectural backbone of every successful Power BI solution. Whether building an executive dashboard or a complex analytics engine, the structural integrity of the data determines the performance, flexibility, and reporting accuracy&lt;/p&gt;

&lt;p&gt;Schemas fall into two primary categories: Star and Snowflake, following general practices of dimensional modeling used widely in analytics and BI. Each defines a different way to model facts and dimensions, balancing simplicity, performance, storage efficiency, and modeling flexibility.&lt;/p&gt;

&lt;p&gt;The Star Schema is usually the recommended approach because it, prioritizes read performance over write efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Star schema
&lt;/h2&gt;

&lt;p&gt;The star schema involves structuring your data into multiple tables such that you have: &lt;br&gt;
Fact tables contain quantitative attributes that you want to measure. &lt;br&gt;
Dimension tables that contain descriptive attributes that group and categorize data from fact 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.amazonaws.com%2Fuploads%2Farticles%2Fj0pwcysuvi7hyy4do4x0.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.amazonaws.com%2Fuploads%2Farticles%2Fj0pwcysuvi7hyy4do4x0.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fact tables
&lt;/h3&gt;

&lt;p&gt;A fact table is the main table that records events (transactions) that happened, so duplicates are normal because the same type of event can occur many times. It’s also the table that changes/updates often compared to dimensions.&lt;br&gt;
eg &lt;code&gt;FactTable -Visits (VisitID, PatientID, DoctorID, FacilityID, DateID, VisitCost, LengthOfStay)&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dimension table
&lt;/h3&gt;

&lt;p&gt;A dimension table is a table that holds information about categorical fields in the fact table and you use to slice and group the facts.&lt;br&gt;
It’s typically smaller than the fact table.&lt;br&gt;
eg &lt;code&gt;Dimension - Patient, Doctor, Facility, Date&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Relationships and cardinality
&lt;/h3&gt;

&lt;p&gt;In Power BI, relationships are typically built by matching one column from one table to one column in another table. That means linking each dimension key to the corresponding key in the visits fact table, e.g., &lt;code&gt;Patient[PatientID] → FactVisits[PatientID], Doctor[DoctorID] → FactVisits[DoctorID], Facility[FacilityID] → FactVisits[FacilityID], and Date[DateID] → FactVisits[DateID].&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If two tables need to match on more than one field (for example, if you had a scenario where uniqueness is defined by both &lt;code&gt;PatientID and DateID together)&lt;/code&gt;, you would create a combined key such as &lt;code&gt;PatientDateKey = PatientID&lt;/code&gt; &amp;amp; "-" &lt;code&gt;&amp;amp; DateID&lt;/code&gt; in both tables and then relate using that single key column.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cardinality&lt;/em&gt; describes how many rows in one table can match rows in another: one-to-one, one-to-many, many-to-one, or many-to-many.If a many-to-many relationship is unavoidable, use a Bridge Table (also known as an Associative Entity) to convert the logic into two one-to-many relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Snowflake Schema
&lt;/h3&gt;

&lt;p&gt;A snowflake schema is a data model where dimension tables are &lt;strong&gt;normalized&lt;/strong&gt; into multiple related tables.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instead of keeping everything in one large dimension table (like a star schema), you split descriptive data into smaller tables to reduce duplication.
&lt;/li&gt;
&lt;li&gt;It’s called “snowflake” because dimensions branch out into sub-dimensions, creating a layered structure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Structure
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fact Table:&lt;/strong&gt; Stores measurable event/transaction data (numeric values) at a specific grain.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dimension Tables:&lt;/strong&gt; Split into multiple connected tables to represent hierarchies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example (healthcare):  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Patient → Ward → Department → Hospital
&lt;/li&gt;
&lt;li&gt;Doctor → Specialty → Department&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fact Table: Visits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;VisitID
&lt;/li&gt;
&lt;li&gt;PatientID
&lt;/li&gt;
&lt;li&gt;DoctorID
&lt;/li&gt;
&lt;li&gt;WardID
&lt;/li&gt;
&lt;li&gt;DateID
&lt;/li&gt;
&lt;li&gt;VisitCost, LengthOfStay
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dimension Tables (normalized)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Patient (PatientID, FullName, WardID)
&lt;/li&gt;
&lt;li&gt;Ward (WardID, WardName, DepartmentID)
&lt;/li&gt;
&lt;li&gt;Department (DepartmentID, DepartmentName, HospitalID)
&lt;/li&gt;
&lt;li&gt;Hospital (HospitalID, HospitalName)
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Relationships
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Still mainly &lt;strong&gt;one-to-many&lt;/strong&gt; relationships.
&lt;/li&gt;
&lt;li&gt;The difference is that dimensions connect through multiple levels (Patient → Ward → Department → Hospital), so filter paths are longer than in a star schema.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good data modelling is critical because it directly dictates the efficiency, accuracy, and usability of your reports. A well-structured model with clear relationships and reduced redundancy improves query performance, allowing dashboards to load faster even as data scales. Furthermore, by enforcing data integrity constraints and defining logical connections between entities, a strong model ensures that calculations, filters, and aggregations remain accurate across the entire system, preventing errors that could lead to misleading insights.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>dataengineering</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>A Beginner’s Guide to Git: Version Control, Tracking Changes, and Pushing Code to GitHub</title>
      <dc:creator>David</dc:creator>
      <pubDate>Sun, 18 Jan 2026 11:27:34 +0000</pubDate>
      <link>https://forem.com/davi__mungai/a-beginners-guide-to-git-version-control-tracking-changes-and-pushing-code-to-github-5h5a</link>
      <guid>https://forem.com/davi__mungai/a-beginners-guide-to-git-version-control-tracking-changes-and-pushing-code-to-github-5h5a</guid>
      <description>&lt;h1&gt;
  
  
  Understanding Push, Pull, and Commit
&lt;/h1&gt;

&lt;p&gt;If you're new to programming, terms like &lt;strong&gt;Git&lt;/strong&gt;, &lt;strong&gt;GitHub&lt;/strong&gt;, &lt;strong&gt;push&lt;/strong&gt;, &lt;strong&gt;pull&lt;/strong&gt;, and &lt;strong&gt;commit&lt;/strong&gt; might seem confusing.&lt;/p&gt;

&lt;p&gt;This guide breaks down these concepts &lt;strong&gt;step by step&lt;/strong&gt;, using &lt;strong&gt;real commands from a beginner’s workflow&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You’ll Learn
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What Git and version control are
&lt;/li&gt;
&lt;li&gt;How to configure Git for the first time
&lt;/li&gt;
&lt;li&gt;How to track file changes
&lt;/li&gt;
&lt;li&gt;How to push and pull code using GitHub
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Understanding Version Control
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Version control&lt;/strong&gt; is a system that helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track changes made to files over time
&lt;/li&gt;
&lt;li&gt;Revert to previous versions when something breaks
&lt;/li&gt;
&lt;li&gt;Collaborate safely with others on the same project
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is the most popular version control system, while &lt;strong&gt;GitHub&lt;/strong&gt; is an online platform where Git repositories are stored and shared.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up Git
&lt;/h2&gt;

&lt;p&gt;Before using Git, configure your identity. This information appears in your commit history and helps others know who made changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"dmungai"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"dmungai@gmail.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify your configuration worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Git prints your username and email, you're all set &lt;/p&gt;




&lt;h2&gt;
  
  
  Git Repositories Explained
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Git repository&lt;/strong&gt; is simply a folder that Git is tracking.&lt;/p&gt;

&lt;p&gt;If you run Git commands outside a repository, you’ll encounter this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fatal: not a git repository (or any of the parent directories): .git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means you're &lt;strong&gt;not inside a Git-tracked project folder&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating Your Working Environment
&lt;/h2&gt;

&lt;p&gt;Start by creating a folder for your project:&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;mkdir &lt;/span&gt;testfolderforcredentials
&lt;span class="nb"&gt;cd &lt;/span&gt;testfolderforcredentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This folder remains a normal directory until you introduce Git.&lt;/p&gt;




&lt;h2&gt;
  
  
  Cloning from GitHub
&lt;/h2&gt;

&lt;p&gt;To work on an existing project, clone it from GitHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dmungai97/dmungai.git
&lt;span class="nb"&gt;cd &lt;/span&gt;dmungai97
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cloning does three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Downloads the project
&lt;/li&gt;
&lt;li&gt;Creates a &lt;code&gt;.git&lt;/code&gt; folder inside it
&lt;/li&gt;
&lt;li&gt;Automatically connects it to GitHub
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Creating and Tracking Files
&lt;/h2&gt;

&lt;p&gt;Create a new file and add some content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi testfile
&lt;span class="nb"&gt;cat &lt;/span&gt;testfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git doesn't automatically track new files. Check what Git sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see &lt;strong&gt;untracked files&lt;/strong&gt; listed.&lt;/p&gt;

&lt;p&gt;To start tracking them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add testfile
git add testfile.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;git status&lt;/code&gt; again to see the files are now &lt;strong&gt;staged&lt;/strong&gt; and ready to be committed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Committing Your Changes
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;commit&lt;/strong&gt; creates a snapshot of your project at a specific point in time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"this is test file for credentials - 1st method"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commits are saved locally&lt;br&gt;&lt;br&gt;
Good commit messages are clear and concise  &lt;/p&gt;


&lt;h2&gt;
  
  
  Pushing to GitHub
&lt;/h2&gt;

&lt;p&gt;Send your commits to GitHub so others can see them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your files are now saved locally and visible on GitHub.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pulling Updates
&lt;/h2&gt;

&lt;p&gt;If changes were made on GitHub or by another team member, download them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Always pull before starting new work to avoid conflicts.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git clone&lt;/code&gt; – Download a repository from GitHub
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git status&lt;/code&gt; – Check which files are tracked or modified
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git add&lt;/code&gt; – Stage files for commit
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git commit -m "message"&lt;/code&gt; – Save changes &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git push&lt;/code&gt; – Upload commits to GitHub
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git pull&lt;/code&gt; – Download latest changes
&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>beginners</category>
      <category>git</category>
      <category>github</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
