<?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: Dalton Imbiru</title>
    <description>The latest articles on DEV Community by Dalton Imbiru (@dalton_imbiru_82680ef8a50).</description>
    <link>https://dev.to/dalton_imbiru_82680ef8a50</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%2F3823429%2F121bfe88-b09b-46a6-b056-ac70f011093b.jpg</url>
      <title>DEV Community: Dalton Imbiru</title>
      <link>https://dev.to/dalton_imbiru_82680ef8a50</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dalton_imbiru_82680ef8a50"/>
    <language>en</language>
    <item>
      <title>Understanding SQL Data Definition Language (DDL): Building the Foundation of Every Database</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Thu, 30 Jul 2026 11:29:12 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/understanding-sql-data-definition-language-ddl-building-the-foundation-of-every-database-1aj5</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/understanding-sql-data-definition-language-ddl-building-the-foundation-of-every-database-1aj5</guid>
      <description>&lt;h2&gt;
  
  
  What is Data Definition Language (DDL)?
&lt;/h2&gt;

&lt;p&gt;Data Definition Language (DDL) is a subset of SQL that deals with the &lt;strong&gt;structure&lt;/strong&gt; of a database rather than the data itself. Unlike Data Manipulation Language (DML), which focuses on inserting, updating, and deleting records, DDL is responsible for creating and organizing the objects that hold the data.&lt;/p&gt;

&lt;p&gt;Database administrators, software developers, and data engineers frequently use DDL when designing new databases or modifying existing ones.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common DDL Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. CREATE
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;CREATE&lt;/code&gt; command is used to create new database objects such as databases and tables.&lt;/p&gt;

&lt;p&gt;For example, creating a table to store employee information:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```sql id="c4w2m9"&lt;br&gt;
CREATE TABLE Employees (&lt;br&gt;
    EmployeeID INT PRIMARY KEY,&lt;br&gt;
    FirstName VARCHAR(50),&lt;br&gt;
    LastName VARCHAR(50),&lt;br&gt;
    Department VARCHAR(50),&lt;br&gt;
    Salary DECIMAL(10,2)&lt;br&gt;
);&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


This command creates a table named **Employees** with five columns and specifies `EmployeeID` as the primary key.

---

### 2. ALTER

As business requirements change, database structures often need to be updated. The `ALTER` command modifies existing database objects.

For example, adding an email column:



```sql id="q9x7ld"
ALTER TABLE Employees
ADD Email VARCHAR(100);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can also use &lt;code&gt;ALTER&lt;/code&gt; to rename columns, change data types, or add constraints.&lt;/p&gt;


&lt;h3&gt;
  
  
  3. DROP
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;DROP&lt;/code&gt; command permanently removes a database object along with all its data.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```sql id="t6r1ke"&lt;br&gt;
DROP TABLE Employees;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Since this action cannot usually be undone, it should be used with caution.

---

### 4. TRUNCATE

`TRUNCATE` removes all rows from a table while keeping the table structure intact.



```sql id="u2m5bz"
TRUNCATE TABLE Employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Unlike &lt;code&gt;DELETE&lt;/code&gt;, &lt;code&gt;TRUNCATE&lt;/code&gt; is generally faster because it removes all records without processing each row individually.&lt;/p&gt;


&lt;h3&gt;
  
  
  5. RENAME
&lt;/h3&gt;

&lt;p&gt;Some database systems allow objects to be renamed.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```sql id="n8v4hf"&lt;br&gt;
ALTER TABLE Employees&lt;br&gt;
RENAME TO Staff;&lt;/p&gt;

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


The exact syntax varies depending on the database management system.

---

## Why DDL Matters

DDL is essential because it defines how data is organized and stored. Without well-designed tables and relationships, retrieving and analyzing data becomes inefficient and prone to errors.

A properly designed database offers several benefits:

* Organizes data logically.
* Reduces redundancy.
* Improves data integrity.
* Supports faster queries.
* Makes future maintenance easier.

Whether you're building a customer database, an inventory system, or a school management application, DDL provides the foundation upon which everything else is built.

---

## DDL vs DML

It's common for beginners to confuse DDL with DML, but they serve different purposes.

| Data Definition Language (DDL)                  | Data Manipulation Language (DML)                 |
| ----------------------------------------------- | ------------------------------------------------ |
| Defines database structures                     | Manipulates data within tables                   |
| Creates and modifies tables                     | Inserts, updates, retrieves, and deletes records |
| Examples: `CREATE`, `ALTER`, `DROP`, `TRUNCATE` | Examples: `SELECT`, `INSERT`, `UPDATE`, `DELETE` |






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

&lt;/div&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding SQL Data Definition Language(DML)</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Thu, 30 Jul 2026 11:26:47 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/understanding-sql-data-definition-languagedml-5g9</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/understanding-sql-data-definition-languagedml-5g9</guid>
      <description>&lt;h2&gt;
  
  
  What is Standard Query Language (SQL)
&lt;/h2&gt;

&lt;p&gt;SQL is the standard language used to communicate with relational databases such as MySQL, PostgreSQL, Microsoft SQL Server, Oracle, and SQLite. Databases organize information into tables made up of rows and columns, making it easier to store and retrieve data efficiently.&lt;/p&gt;

&lt;p&gt;Businesses use SQL to manage customer information, employee records, sales transactions, inventory, and many other types of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Manipulation Language (DML)
&lt;/h2&gt;

&lt;p&gt;Data Manipulation Language (DML) consists of commands used to interact with the data stored in tables.&lt;/p&gt;

&lt;p&gt;The most common DML commands include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SELECT&lt;/strong&gt; – Retrieves data from a table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;INSERT&lt;/strong&gt; – Adds new records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UPDATE&lt;/strong&gt; – Modifies existing records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DELETE&lt;/strong&gt; – Removes records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, retrieving all employees from a 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="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands form the foundation of everyday database operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Essential SQL Keywords
&lt;/h2&gt;

&lt;p&gt;SQL provides several keywords that make querying data more effective.&lt;/p&gt;

&lt;p&gt;Some of the most commonly used include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;FROM&lt;/code&gt; – Specifies the table.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WHERE&lt;/code&gt; – Filters records.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ORDER BY&lt;/code&gt; – Sorts results.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DISTINCT&lt;/code&gt; – Removes duplicates.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LIMIT&lt;/code&gt; or &lt;code&gt;TOP&lt;/code&gt; – Restricts the number of rows returned.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AS&lt;/code&gt; – Creates aliases for columns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These keywords help retrieve information accurately and present it in a meaningful way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filtering Data with Operators
&lt;/h2&gt;

&lt;p&gt;Filtering allows us to retrieve only the data that meets specific conditions.&lt;/p&gt;

&lt;p&gt;Common comparison operators include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;=&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;gt;=&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;=&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Logical operators such as &lt;code&gt;AND&lt;/code&gt;, &lt;code&gt;OR&lt;/code&gt;, and &lt;code&gt;NOT&lt;/code&gt; allow multiple conditions to be combined.&lt;/p&gt;

&lt;p&gt;Other useful operators include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;BETWEEN&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IN&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LIKE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&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="o"&gt;*&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;WHERE&lt;/span&gt; &lt;span class="n"&gt;Amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;
&lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Completed'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filtering is one of the most frequently used SQL skills because it helps answer specific business questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining Tables with SQL Joins
&lt;/h2&gt;

&lt;p&gt;In most databases, information is stored across multiple tables. SQL joins make it possible to combine related data using a common key.&lt;/p&gt;

&lt;p&gt;The four main joins are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;INNER JOIN&lt;/strong&gt; – Returns matching records from both tables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LEFT JOIN&lt;/strong&gt; – Returns all records from the left table and matching records from the right.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RIGHT JOIN&lt;/strong&gt; – Returns all records from the right table and matching records from the left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FULL OUTER JOIN&lt;/strong&gt; – Returns all records from both tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Joins are essential for creating comprehensive reports that combine customer, product, employee, and sales information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using CASE WHEN Statements
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;CASE WHEN&lt;/code&gt; statement introduces conditional logic into SQL queries. It works similarly to an IF-ELSE statement in programming languages.&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 sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;CustomerName&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;CASE&lt;/span&gt;
           &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;Amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'High Value'&lt;/span&gt;
           &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;Amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'Medium Value'&lt;/span&gt;
           &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="s1"&gt;'Low Value'&lt;/span&gt;
       &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;Category&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;code&gt;CASE WHEN&lt;/code&gt; is useful for categorizing data, assigning grades, creating customer segments, and generating business-friendly reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Row-Level Functions
&lt;/h2&gt;

&lt;p&gt;Row-level functions operate on individual rows to clean and transform data.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;UPPER()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LOWER()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CONCAT()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ROUND()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LENGTH()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TRIM()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These functions improve data consistency and make reports more readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling NULL Values
&lt;/h2&gt;

&lt;p&gt;Missing data is common in real-world databases. SQL provides several ways to handle NULL values.&lt;/p&gt;

&lt;p&gt;Useful functions include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IS NULL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IS NOT NULL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;COALESCE()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NULLIF()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Replacing missing values before analysis helps improve the accuracy of reports and calculations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with Date and Time
&lt;/h2&gt;

&lt;p&gt;Date and time functions simplify time-based analysis.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CURRENT_DATE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CURRENT_TIMESTAMP&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DATEDIFF()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;EXTRACT()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DATE_FORMAT()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These functions help answer questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many orders were placed this month?&lt;/li&gt;
&lt;li&gt;How long did delivery take?&lt;/li&gt;
&lt;li&gt;Which customers have not purchased recently?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Time-based analysis is essential for tracking trends and business performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Subqueries
&lt;/h2&gt;

&lt;p&gt;A subquery is a query nested inside another query.&lt;/p&gt;

&lt;p&gt;For example, to find products priced above the average:&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;ProductName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Price&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Subqueries make it possible to solve complex problems without manually calculating intermediate results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simplifying Queries with Common Table Expressions (CTEs)
&lt;/h2&gt;

&lt;p&gt;Common Table Expressions (CTEs) improve the readability and organization of complex SQL queries.&lt;/p&gt;

&lt;p&gt;Example:&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;WITH&lt;/span&gt; &lt;span class="n"&gt;CustomerSales&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;CustomerID&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="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;TotalSales&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;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;CustomerID&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;CustomerSales&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;TotalSales&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CTEs make large queries easier to understand, maintain, and debug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bringing It All Together
&lt;/h2&gt;

&lt;p&gt;Imagine you're working as a Data Analyst for an e-commerce company. Management asks you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display completed orders only.&lt;/li&gt;
&lt;li&gt;Combine customer and order information.&lt;/li&gt;
&lt;li&gt;Categorize customers based on spending.&lt;/li&gt;
&lt;li&gt;Replace missing contact details.&lt;/li&gt;
&lt;li&gt;Calculate delivery time.&lt;/li&gt;
&lt;li&gt;Identify customers spending above the average.&lt;/li&gt;
&lt;li&gt;Generate a clean sales report.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using filtering, joins, &lt;code&gt;CASE WHEN&lt;/code&gt;, row-level functions, NULL handling, date functions, subqueries, and CTEs, you can answer all these questions with efficient and readable SQL queries.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to connect Power BI to SQL Databases</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Thu, 30 Jul 2026 10:27:49 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/how-to-connect-power-bi-to-sql-databases-33f5</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/how-to-connect-power-bi-to-sql-databases-33f5</guid>
      <description>&lt;p&gt;Power BI can connect directly to SQL databases either locally or in the cloud. By connecting Power BI to a SQL database, organizations can analyze live data, automate reporting, and make data-driven decisions without relying on manual data exports.&lt;/p&gt;

&lt;p&gt;The following is a guide on how to connect Power BI to both local SQL databases and cloud-based SQL databases.&lt;/p&gt;




&lt;p&gt;To connect to a SQL database, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Power BI Desktop installed.&lt;/li&gt;
&lt;li&gt;Access to the SQL database.&lt;/li&gt;
&lt;li&gt;Database server name.&lt;/li&gt;
&lt;li&gt;Database name.&lt;/li&gt;
&lt;li&gt;Username and password (if required).&lt;/li&gt;
&lt;li&gt;Internet connectivity (for cloud databases).&lt;/li&gt;
&lt;li&gt;PostgreSQL or SQL Server drivers installed if necessary.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Connecting Power BI to a Local SQL Database
&lt;/h2&gt;

&lt;p&gt;A local SQL database is hosted on your computer or an organisation's internal network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Open Power BI Desktop and get data
&lt;/h2&gt;

&lt;p&gt;If using PostgreSQL:&lt;/p&gt;

&lt;p&gt;Launch &lt;strong&gt;Power BI Desktop - Home - Get Data - PostgreSQL Database&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpmx1whi8cm4r0tbaw695.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%2Fpmx1whi8cm4r0tbaw695.png" alt="image" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Before Entering Connection details, go to PostgreSQL Connections and copy and paste the connection details into Power BI. That is, the server, which is the host, followed by a colon then copy and paste the port thereafter.&lt;br&gt;
Copy and paste the Database Name and click ok.&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%2Fr63fa8aqhk8yv3w91zvj.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%2Fr63fa8aqhk8yv3w91zvj.png" alt="image" width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After Loading, you will be directed to a navigator page where you will be able to select the data needed and load and transform the data.&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%2Fkqclacq2bjkcv115u9i4.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%2Fkqclacq2bjkcv115u9i4.png" alt="image" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;strong&gt;Transform Data&lt;/strong&gt; if cleaning or transforming data is required before loading.&lt;/p&gt;




&lt;h2&gt;
  
  
  Connecting Power BI to a Cloud-Based SQL Database
&lt;/h2&gt;

&lt;p&gt;Cloud databases are hosted on remote servers such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft Azure SQL Database&lt;/li&gt;
&lt;li&gt;Amazon RDS&lt;/li&gt;
&lt;li&gt;Google Cloud SQL&lt;/li&gt;
&lt;li&gt;Aiven PostgreSQL&lt;/li&gt;
&lt;li&gt;ElephantSQL&lt;/li&gt;
&lt;li&gt;Supabase PostgreSQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The connection process is similar but requires internet access.&lt;br&gt;
Using Aiven PostgreSQL&lt;/p&gt;




&lt;p&gt;Before Entering Connection details, go to Aiven and copy and paste the connection details into Power BI. That is, the server, which is the host, followed by a colon then copy and paste the port thereafter.&lt;br&gt;
Copy and paste the Database Name and click ok.&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%2Fr63fa8aqhk8yv3w91zvj.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%2Fr63fa8aqhk8yv3w91zvj.png" alt="image" width="799" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After Loading, you will be directed to a navigator page where you will be able to select the data needed and load and transform the data.&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%2Fkqclacq2bjkcv115u9i4.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%2Fkqclacq2bjkcv115u9i4.png" alt="image" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;strong&gt;Transform Data&lt;/strong&gt; if cleaning or transforming data is required before loading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importing the Aiven CA Certificate (Windows)
&lt;/h2&gt;

&lt;p&gt;Aiven PostgreSQL uses SSL encryption to secure connections. &lt;/p&gt;

&lt;h2&gt;
  
  
  Download the CA Certificate
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your &lt;strong&gt;Aiven Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open your PostgreSQL service.&lt;/li&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Overview&lt;/strong&gt; or &lt;strong&gt;Connection Information&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Download the &lt;strong&gt;CA Certificate&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a8au9wk7z36vkcwet6m.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%2F2a8au9wk7z36vkcwet6m.png" alt="Download CA Certificate" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Open the Certificate Manager
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Press the &lt;strong&gt;Windows&lt;/strong&gt; key.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;Manage User Certificates&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open the application.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhg111tisbuzhps2a7akg.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%2Fhg111tisbuzhps2a7akg.png" alt="Manage User Certificates" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Import the Certificate
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the Certificate Manager, expand:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Trusted Root Certification Authorities
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Select:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Right-click &lt;strong&gt;Certificates&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   All Tasks → Import
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Browse&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to your &lt;strong&gt;Downloads&lt;/strong&gt; folder and select the &lt;strong&gt;CA Certificate&lt;/strong&gt; you downloaded from Aiven.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3zlzyba5o8645tqga8t.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%2Fe3zlzyba5o8645tqga8t.png" alt="Import Certificate" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensure the certificate is imported into:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Trusted Root Certification Authorities
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A confirmation message should appear indicating that the import was successful.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Verify the Installation
&lt;/h2&gt;

&lt;p&gt;After importing the certificate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart &lt;strong&gt;Power BI Desktop&lt;/strong&gt; if it was open.&lt;/li&gt;
&lt;li&gt;Connect to your Aiven PostgreSQL database using the PostgreSQL connector.&lt;/li&gt;
&lt;li&gt;The SSL certificate should now be trusted, allowing Power BI to establish a secure connection without certificate errors.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>How to publish a Power BI report and embed it into a website using an iframe.</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Wed, 15 Apr 2026 10:57:37 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/how-to-publish-a-power-bi-report-and-embed-it-into-a-website-using-an-iframe-3nm6</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/how-to-publish-a-power-bi-report-and-embed-it-into-a-website-using-an-iframe-3nm6</guid>
      <description>&lt;h2&gt;
  
  
  Publishing and Embedding Power BI Reports on the Web
&lt;/h2&gt;

&lt;p&gt;Power BI is a business intelligence tool from Microsoft that makes it easy for users to transform raw data into meaningful insights using interactive dashboards and reports. &lt;/p&gt;

&lt;p&gt;Power BI's most powerful feature is the ability to publish reports online and embed them into websites, allowing others to interact with the data without having direct access to Power BI.&lt;/p&gt;

&lt;p&gt;This article will take you through the process of creating a workspace to embedding a report using an iframe, with visual guidelines and key insights.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Creating a Workspace in Power BI
&lt;/h2&gt;

&lt;p&gt;This is where reports, dashboards, and datasets are stored and managed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Create a Workspace
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;On your browser, go to Power BI Service
&lt;/li&gt;
&lt;li&gt;Sign in with your account
&lt;/li&gt;
&lt;li&gt;On the left sidebar, click &lt;strong&gt;Workspaces&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create a workspace&lt;/strong&gt; &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%2Ffdqlnmwdo910tn9fv06t.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%2Ffdqlnmwdo910tn9fv06t.png" alt="image" width="799" height="430"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter:

&lt;ul&gt;
&lt;li&gt;Workspace name
&lt;/li&gt;
&lt;li&gt;Description
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt;
&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%2Ftkf1eb7n1l3tlqlea8wl.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%2Ftkf1eb7n1l3tlqlea8wl.png" alt="image" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Workspaces help organize your reports
&lt;/li&gt;
&lt;li&gt;You can collaborate with others by adding members
&lt;/li&gt;
&lt;li&gt;“My Workspace” is private, while new workspaces can be shared
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Uploading and Publishing Your Report
&lt;/h2&gt;

&lt;p&gt;After creating a report in Power BI Desktop, the next step is publishing it to the Power BI Service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Publish
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open your report in Power BI Desktop
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;File → Publish → Publish to Power BI&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Sign in if prompted
&lt;/li&gt;
&lt;li&gt;Select the workspace you created
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Select&lt;/strong&gt;
&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%2Fiqyxrypos84z160nyt7d.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%2Fiqyxrypos84z160nyt7d.png" alt="Image" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify Upload
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go back to Power BI Service
&lt;/li&gt;
&lt;li&gt;Open your workspace
&lt;/li&gt;
&lt;li&gt;Confirm your report appears under:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reports&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Datasets&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&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%2Fka44vvxh5nmlb6rqcia3.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%2Fka44vvxh5nmlb6rqcia3.png" alt="Image" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Any updates in Power BI Desktop can be republished
&lt;/li&gt;
&lt;li&gt;Changes reflect automatically in the online version
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Generating the Embed Code
&lt;/h2&gt;

&lt;p&gt;To display your report on a website, you need an embed code, which Power BI generates for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Generate Embed Code
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open your report in Power BI Service
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;File&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Embed report&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Publish to web (public)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create embed code&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Confirm the warning message
&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%2Fs0x2r042d6n3omi51b4m.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%2Fs0x2r042d6n3omi51b4m.png" alt="Image" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What You Get
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A public URL
&lt;/li&gt;
&lt;li&gt;An iframe embed code
&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%2F2c0q3f542jw99kl974ka.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%2F2c0q3f542jw99kl974ka.png" alt="Image" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Uploading the Power BI report into a website
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open a new file in Visual Studio Code, generate an HTML boilerplate, and paste the iframe link into the body section.&lt;br&gt;
-Run the HTML file.&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%2Fwtddjf5u2zujw80hstit.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%2Fwtddjf5u2zujw80hstit.png" alt="Image" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After running the HTML file, a webpage will load in the browser displaying the Power BI Dashboard that a user can interact with.&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%2Ff5uwud7e38trwra2g9b9.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%2Ff5uwud7e38trwra2g9b9.png" alt="Image" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Data Modelling in Power BI: Joins, Relationships, and Schemas Explained</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Sun, 05 Apr 2026 20:22:55 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/understanding-data-modelling-in-power-bi-joins-relationships-and-schemas-explained-51gf</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/understanding-data-modelling-in-power-bi-joins-relationships-and-schemas-explained-51gf</guid>
      <description>&lt;p&gt;Data modelling is the foundation of effective data analysis in Power BI. A well-structured model ensures faster performance, accurate calculations, and easier report building. This article breaks down everything you need to know—from SQL joins and Power BI relationships to schemas and practical implementation steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Data Modelling?
&lt;/h2&gt;

&lt;p&gt;Data modelling is the process of organising data into tables and defining how those tables relate to each other so that analysis becomes meaningful and efficient.&lt;/p&gt;

&lt;p&gt;In Power BI, data modeling involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Structuring tables (Fact and Dimension)&lt;/li&gt;
&lt;li&gt; Defining relationships between tables&lt;/li&gt;
&lt;li&gt; Optimizing performance and usability&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SQL Joins Explained (With Examples)
&lt;/h2&gt;

&lt;p&gt;Joins combine data from two or more tables based on a common column.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Customers&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Alex&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Orders&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  INNER JOIN
&lt;/h2&gt;

&lt;p&gt;Returns only matching records from both tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; When you only want valid matches (e.g., customers who made purchases).&lt;/p&gt;

&lt;h2&gt;
  
  
  LEFT JOIN
&lt;/h2&gt;

&lt;p&gt;Returns all records from the left table + matching from the right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Alex&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;&lt;strong&gt;Use case:&lt;/strong&gt; Show all customers, even those without orders.&lt;/p&gt;

&lt;h2&gt;
  
  
  RIGHT JOIN
&lt;/h2&gt;

&lt;p&gt;Returns all records from the right table + matching from the left.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; Show all orders, even if customer info is missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  FULL OUTER JOIN
&lt;/h2&gt;

&lt;p&gt;Returns all records from both tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Mary&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Alex&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; Complete data reconciliation.&lt;/p&gt;

&lt;h2&gt;
  
  
  LEFT ANTI JOIN
&lt;/h2&gt;

&lt;p&gt;Returns rows from left table that have &lt;strong&gt;no match&lt;/strong&gt; in right table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Alex&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; Identify customers who never purchased.&lt;/p&gt;

&lt;h2&gt;
  
  
  RIGHT ANTI JOIN
&lt;/h2&gt;

&lt;p&gt;Returns rows from right table with &lt;strong&gt;no match&lt;/strong&gt; in left table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;OrderID&lt;/th&gt;
&lt;th&gt;CustomerID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt; Identify orphan records (e.g., invalid orders).&lt;/p&gt;

&lt;h2&gt;
  
  
  Joins in Power BI (Power Query)
&lt;/h2&gt;

&lt;p&gt;Power BI implements joins in &lt;strong&gt;Power Query&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Home → Transform Data&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select a table&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Merge Queries&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select second table&lt;/li&gt;
&lt;li&gt;Choose matching column(s)&lt;/li&gt;
&lt;li&gt;Select join type:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Inner&lt;/li&gt;
&lt;li&gt;Left Outer&lt;/li&gt;
&lt;li&gt;Right Outer&lt;/li&gt;
&lt;li&gt;Full Outer&lt;/li&gt;
&lt;li&gt;Left Anti&lt;/li&gt;
&lt;li&gt;Right Anti

&lt;ol&gt;
&lt;li&gt;Expand columns to finalize&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Relationships in Power BI
&lt;/h2&gt;

&lt;p&gt;Unlike SQL joins (which combine tables physically), Power BI relationships connect tables logically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Relationships
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. One-to-Many (1:M)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One record in Table A → Many in Table B&lt;/li&gt;
&lt;li&gt;Example: Customers → Orders&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most common relationship&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Many-to-Many (M:M)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Many records in both tables&lt;/li&gt;
&lt;li&gt;Example: Students ↔ Courses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. One-to-One (1:1)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One record matches exactly one record&lt;/li&gt;
&lt;li&gt;Example: Employee ↔ Employee Details&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cardinality
&lt;/h2&gt;

&lt;p&gt;Defines how tables relate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-to-Many&lt;/li&gt;
&lt;li&gt;Many-to-One&lt;/li&gt;
&lt;li&gt;Many-to-Many&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cross-Filter Direction
&lt;/h2&gt;

&lt;p&gt;Controls how filters flow between tables.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single direction&lt;/strong&gt; → One way (recommended)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both directions&lt;/strong&gt; → Two-way filtering (use carefully)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Active vs Inactive Relationships
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Active relationship&lt;/strong&gt; → Default used in visuals&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inactive relationship&lt;/strong&gt; → Exists but is not used unless activated via DAX (&lt;code&gt;USERELATIONSHIP&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order Date (Active)&lt;/li&gt;
&lt;li&gt;Ship Date (Inactive)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating Relationships in Power BI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Method 1: Model View
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Model View&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Drag one column to another&lt;/li&gt;
&lt;li&gt;Relationship is created automatically&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Method 2: Manage Relationships
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Home → Manage Relationships&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;Columns&lt;/li&gt;
&lt;li&gt;Cardinality&lt;/li&gt;
&lt;li&gt;Cross-filter direction

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Joins vs Relationships (Key Difference)
&lt;/h2&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;Joins&lt;/th&gt;
&lt;th&gt;Relationships&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Where used&lt;/td&gt;
&lt;td&gt;Power Query&lt;/td&gt;
&lt;td&gt;Data Model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Result&lt;/td&gt;
&lt;td&gt;Combines tables&lt;/td&gt;
&lt;td&gt;Keeps tables separate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Can increase size&lt;/td&gt;
&lt;td&gt;More efficient&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flexibility&lt;/td&gt;
&lt;td&gt;Static&lt;/td&gt;
&lt;td&gt;Dynamic&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;h2&gt;
  
  
  Fact Table
&lt;/h2&gt;

&lt;p&gt;Contains measurable data (numbers)&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Sales&lt;/li&gt;
&lt;li&gt;Revenue&lt;/li&gt;
&lt;li&gt;Quantity&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Dimension Table
&lt;/h2&gt;

&lt;p&gt;Contains descriptive attributes&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Customer Name&lt;/li&gt;
&lt;li&gt;Product Category&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example Model
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;FactSales&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OrderID&lt;/li&gt;
&lt;li&gt;CustomerID&lt;/li&gt;
&lt;li&gt;ProductID&lt;/li&gt;
&lt;li&gt;SalesAmount&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DimCustomer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CustomerID&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DimProduct&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ProductID&lt;/li&gt;
&lt;li&gt;Category&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h2&gt;
  
  
  Star Schema
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One central fact table&lt;/li&gt;
&lt;li&gt;Connected to multiple dimension tables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Snowflake Schema
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dimensions are normalized (split into multiple tables)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product → Category → Department&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Flat Table (Denormalized / DLAT)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;All data in one table&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Schema&lt;/th&gt;
&lt;th&gt;When to Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Star&lt;/td&gt;
&lt;td&gt;Most Power BI reports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snowflake&lt;/td&gt;
&lt;td&gt;Complex hierarchical data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flat Table&lt;/td&gt;
&lt;td&gt;Small datasets or quick analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Role-Playing Dimensions
&lt;/h2&gt;

&lt;p&gt;A role-playing dimension is a table used multiple times for different purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Date Table&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order Date&lt;/li&gt;
&lt;li&gt;Ship Date&lt;/li&gt;
&lt;li&gt;Delivery Date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Power BI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate the Date table&lt;/li&gt;
&lt;li&gt;Create separate relationships&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Ambiguous relationships&lt;br&gt;
Happens with multiple paths between tables&lt;/p&gt;

&lt;p&gt;Many-to-many confusion&lt;br&gt;
Can lead to incorrect aggregations&lt;/p&gt;

&lt;p&gt;Circular relationships&lt;br&gt;
Causes errors&lt;/p&gt;

&lt;p&gt;Poor performance&lt;br&gt;
Caused by flat tables or too many joins&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use star schema&lt;/li&gt;
&lt;li&gt;Avoid unnecessary bi-directional filters&lt;/li&gt;
&lt;li&gt;Keep relationships simple&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-by-Step: Building a Model in Power BI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Load Data
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Home → Get Data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Clean Data (Power Query)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Remove duplicates&lt;/li&gt;
&lt;li&gt;Handle nulls&lt;/li&gt;
&lt;li&gt;Merge tables if needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Create Relationships
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to Model View&lt;/li&gt;
&lt;li&gt;Drag and connect tables&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Validate Model
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check cardinality&lt;/li&gt;
&lt;li&gt;Ensure no ambiguous paths&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Optimize
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use star schema&lt;/li&gt;
&lt;li&gt;Reduce columns&lt;/li&gt;
&lt;li&gt;Avoid many-to-many unless necessary&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Data modeling in Power BI is not just technical, it’s strategic. Understanding joins helps you prepare data, while relationships allow you to analyze it efficiently. By structuring your data into fact and dimension tables and choosing the right schema (preferably star), you create a model that is both powerful and scalable.&lt;/p&gt;

&lt;p&gt;Mastering these concepts transforms Power BI from a simple visualization tool into a robust analytics engine and ultimately changes how you interpret and interact with data.&lt;/p&gt;

</description>
      <category>data</category>
      <category>microsoft</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Excel is Used in Real-World Data Analysis</title>
      <dc:creator>Dalton Imbiru</dc:creator>
      <pubDate>Mon, 23 Mar 2026 08:59:53 +0000</pubDate>
      <link>https://dev.to/dalton_imbiru_82680ef8a50/how-excel-is-used-in-real-world-data-analysis-1emk</link>
      <guid>https://dev.to/dalton_imbiru_82680ef8a50/how-excel-is-used-in-real-world-data-analysis-1emk</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;What is Excel?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Microsoft Excel is a spreadsheet program developed by Microsoft that is used to organize, analyze, and visualize data.&lt;br&gt;
Think of it as a digital table made up of rows and columns, where each box (a cell) can hold numbers, text, or formulas.&lt;/p&gt;

&lt;p&gt;Microsoft Excel is more than just a spreadsheet tool; it is a practical engine for handling real-world data across industries. From small businesses to global corporations, Excel is used daily to organize information, uncover patterns, and support decision-making.&lt;/p&gt;

&lt;p&gt;In business, Excel is often used for budgeting and financial analysis. For example, a company can track its monthly expenses and revenue, then use formulas like SUM to calculate totals or IF statements to determine profit or loss. A manager might build a financial model to predict future performance based on past trends, helping guide decisions such as hiring or investment.&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%2F8rbgqovcuaf8cy83c3bo.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%2F8rbgqovcuaf8cy83c3bo.png" alt="_The total sum of salary of employees_=SUM(G2:G877)" width="800" height="428"&gt;&lt;/a&gt;&lt;em&gt;Image showing SUM OF Employees salary.&lt;/em&gt;&lt;br&gt;
FORMULAS: &lt;br&gt;
=SUM(G2:G877)&lt;br&gt;
=SUMIFS(AF2:AF877, AE2:AE877, "London", W2:W877, "Single", S2:S877, "Female")&lt;/p&gt;

&lt;p&gt;In data analysis, Excel allows users to clean, sort, and interpret large datasets. Features like PivotTables make it easy to summarize data—for instance, a sales team can quickly see which product sells the most in a specific region. Functions like VLOOKUP or XLOOKUP help combine data from different tables, which is useful when matching customer records or inventory lists.&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%2F48s24oghseqo8lfccgnw.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%2F48s24oghseqo8lfccgnw.png" alt="Pivot Table" width="800" height="431"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image showing Pivot Table&lt;/em&gt;&lt;br&gt;
FORMULAS:&lt;br&gt;
VLOOKUP(10865,A1:AJ877,4,FALSE)&lt;br&gt;
INDEX(G2:G877,MATCH(10865,A1:A877,0))&lt;/p&gt;

&lt;p&gt;In education, students and teachers use Excel to manage grades and analyze performance. A teacher might calculate class averages using AVERAGE, identify top-performing students, or visualize results using charts like bar graphs and pie charts.&lt;/p&gt;

&lt;p&gt;In logistics and operations, Excel helps track inventory, orders, and deliveries. A small business, for example, can monitor stock levels and use conditional formatting to highlight items that are running low. This helps prevent shortages and improves efficiency.&lt;/p&gt;

&lt;p&gt;In human resources, Excel is used to manage employee data, payroll, and attendance. Functions can calculate salaries, deductions, and overtime automatically, reducing manual work and errors.&lt;/p&gt;

&lt;p&gt;Excel is also widely used for data visualization. Charts and dashboards turn raw numbers into insights—like showing sales growth over time or comparing performance across departments. This makes it easier for decision-makers to understand complex information quickly.&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%2Fta5r2ed6sw8pt0f5hlxg.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%2Fta5r2ed6sw8pt0f5hlxg.png" alt="Charts" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ultimately, learning Excel has changed how I interact with data. Instead of seeing numbers as static information, I have began to recognize patterns, relationships, and insights. It has shifted my thinking from simply recording data to actively interpreting it, enabling more informed decisions in both academic and professional settings.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>microsoft</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
