<?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: Gracemunyi</title>
    <description>The latest articles on DEV Community by Gracemunyi (@gracemunyi).</description>
    <link>https://dev.to/gracemunyi</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%2F3850955%2F913d9103-b4b9-49bc-b48b-563ea69f9a14.png</url>
      <title>DEV Community: Gracemunyi</title>
      <link>https://dev.to/gracemunyi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gracemunyi"/>
    <language>en</language>
    <item>
      <title>Understanding PostgreSQL The Practical Way: From Database Structure to Data Querying</title>
      <dc:creator>Gracemunyi</dc:creator>
      <pubDate>Sun, 12 Apr 2026 15:35:51 +0000</pubDate>
      <link>https://dev.to/gracemunyi/learning-postgresql-the-practical-way-understanding-ddl-dml-and-data-transformation-4a34</link>
      <guid>https://dev.to/gracemunyi/learning-postgresql-the-practical-way-understanding-ddl-dml-and-data-transformation-4a34</guid>
      <description>&lt;p&gt;Week 3 of my Data Engineering journey was all about hands-on PostgreSQL. Here’s a simple summary of what I learnt, from building database structures to managing and transforming data with SQL queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database structure (Schema / structure design)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Creating tables&lt;/code&gt; using CREATE TABLE&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Defining columns&lt;/code&gt; and data types&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data management (DML)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;INSERT&lt;/code&gt; → adding data
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;UPDATE&lt;/code&gt; → modifying data
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DELETE&lt;/code&gt; → removing data &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data transformation (querying logic)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CASE WHEN&lt;/code&gt; → converting raw values into categories&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WHERE&lt;/code&gt; → filtering specific data sets&lt;/li&gt;
&lt;li&gt;Operators like &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;BETWEEN&lt;/code&gt;, &lt;code&gt;IN&lt;/code&gt;, and &lt;code&gt;LIKE&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. What are DDL and DML in SQL?
&lt;/h2&gt;

&lt;p&gt;In SQL, commands are generally divided into Five main categories: &lt;strong&gt;Data Definition Language (DDL)&lt;/strong&gt;, &lt;strong&gt;Data Manipulation Language (DML)&lt;/strong&gt;, &lt;strong&gt;Data Query Language (DQL)&lt;/strong&gt;, &lt;strong&gt;Transaction Control Language (TCL)&lt;/strong&gt;, and Data Control Language (DCL)**.&lt;/p&gt;

&lt;p&gt;Today, we cover the first two: &lt;strong&gt;DDL&lt;/strong&gt; and &lt;strong&gt;DML&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DDL (Data Definition Language)&lt;/strong&gt;: It is used to define, shape  and manage the &lt;strong&gt;structure&lt;/strong&gt; of a database. This includes creating, altering, and deleting schemas and tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DML (Data Manipulation Language)&lt;/strong&gt;: It deals with the &lt;strong&gt;data inside the database&lt;/strong&gt;. It is used to manage the data within the tables e.g. adding, updating, or removing records.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. DDL (Data Definition Language):
&lt;/h2&gt;

&lt;p&gt;We create schema and tables structure here. &lt;br&gt;
Commands mostly used here include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CREATE&lt;/strong&gt; : Used to build things inside an SQL database
To create a table, we we will need &lt;strong&gt;column name, data type, constraints (rules like Not Null, unique)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ALTER&lt;/strong&gt;: Used for changing or correcting the structure of a table. You can add or remove columns here from an already created table instead of deleting the whole table first to create a new updated one.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DROP&lt;/strong&gt;: Used to delete the whole table or just one column &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TRUNCATE&lt;/strong&gt;: Used to removes all rows and data inside a table but retains the structure of the table.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additional commands such as &lt;strong&gt;Int, varchar, date, decimal&lt;/strong&gt; will also be used in defining the &lt;strong&gt;column types&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;-&lt;strong&gt;&lt;em&gt;Varchar&lt;/em&gt;&lt;/strong&gt;: used to refer to texts, strings characters columns e.g &lt;em&gt;&lt;code&gt;Grace Munyi&lt;/code&gt;&lt;/em&gt;. &lt;br&gt;
-&lt;strong&gt;&lt;em&gt;Int&lt;/em&gt;&lt;/strong&gt; : used to refer to integers, numbers e.g &lt;em&gt;&lt;code&gt;1,2, 34,65,100&lt;/code&gt;&lt;/em&gt;&lt;br&gt;
-&lt;strong&gt;&lt;em&gt;Decimal&lt;/em&gt;&lt;/strong&gt; : Used to refer to values that are not in whole number format e.g currency &lt;em&gt;&lt;code&gt;3563.75&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;56926.77&lt;/code&gt;&lt;/em&gt; etc&lt;br&gt;
-&lt;strong&gt;&lt;em&gt;Date&lt;/em&gt;&lt;/strong&gt; : used to refer to calendar date columns e.g &lt;em&gt;&lt;code&gt;2026-04-12&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How I  created a Schema, Schema Path and Tables
&lt;/h3&gt;
&lt;h6&gt;
  
  
  1) Creating a Schema
&lt;/h6&gt;

&lt;p&gt;-- Creating a schema if it doesn't exist&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;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;training&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h6&gt;
  
  
  2) Set a path to the created schema above
&lt;/h6&gt;

&lt;p&gt;-This is done instead of having to add the schema name in the table names that you will create. E.g. instead of creating students table called &lt;code&gt;training.students&lt;/code&gt;,  your name will simply be &lt;code&gt;students&lt;/code&gt;.&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;set&lt;/span&gt; &lt;span class="n"&gt;search_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;trainingdb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  3) Create tables
&lt;/h6&gt;

&lt;p&gt;-- Creating a table called students inside the Schema.&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;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;student_id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;grade&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;enrollment_date&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  4) Alter a table
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;We are adding a column into the students table created
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt; 
&lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  5) DROP Whole table or One Column
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;To drop the whole students table created.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-- To drop just one column in the students table created e.g   &lt;code&gt;enrollment_date&lt;/code&gt; column&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;enrollment_date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  6) RENAME a Column
&lt;/h6&gt;

&lt;p&gt;-- If we want to rename one column e.g &lt;em&gt;email column&lt;/em&gt; added earlier to &lt;em&gt;student_email&lt;/em&gt;&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;
&lt;span class="k"&gt;RENAME&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;student_email&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  7) TRUNCATE
&lt;/h6&gt;

&lt;p&gt;-- If we wanted to clear the students table by deleting the data that was in it, we will use &lt;code&gt;Truncate&lt;/code&gt;.&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;TRUNCATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Used to manage the data within the tables i.e. adding, updating, or removing records.&lt;/p&gt;

&lt;h6&gt;
  
  
  1) INSERT data
&lt;/h6&gt;

&lt;p&gt;To insert data in the column names created&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;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;students&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;age&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Alice'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Alice@gmail.com'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  2) UPDATE data
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;To update a variable in the table e.g Change Alice's grade from an &lt;code&gt;A&lt;/code&gt; to &lt;code&gt;B&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'B'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Alice'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  3) DELETE data
&lt;/h6&gt;

&lt;p&gt;To delete a student record from the 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;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Alice'&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;Please remember&lt;/strong&gt;; When using &lt;code&gt;UPDATE&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; always include the  &lt;code&gt;WHERE&lt;/code&gt; command too to specify the specific column/s you want affected. Otherwise, without it, every row gets affected.&lt;/p&gt;

&lt;p&gt;These commands helped me fully manage both the structure and the data in my database.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. How filtering with WHERE works
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;WHERE clause&lt;/strong&gt; is used to filter records based on specific conditions. It allowed to retrieve only the data i needed.&lt;br&gt;
Commands used together with &lt;strong&gt;WHERE&lt;/strong&gt; include; &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;BETWEEN&lt;/code&gt;, &lt;code&gt;IN&lt;/code&gt;, &lt;code&gt;LIKE&lt;/code&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here we use;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SELECT * From Table name&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;WHERE  column name, filter condition&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Examples of operators:&lt;/p&gt;
&lt;h6&gt;
  
  
  1) &lt;strong&gt;= (equals)&lt;/strong&gt;
&lt;/h6&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;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  2) &lt;strong&gt;&amp;gt; (greater than)&lt;/strong&gt;
&lt;/h6&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;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  3) &lt;strong&gt;BETWEEN&lt;/strong&gt;
&lt;/h6&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;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  4) &lt;strong&gt;IN&lt;/strong&gt;
&lt;/h6&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;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'B'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h6&gt;
  
  
  5) &lt;strong&gt;LIKE&lt;/strong&gt; (pattern matching)
&lt;/h6&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;students&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="s1"&gt;'A%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- names starting with A&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;WHERE&lt;/code&gt; clause is very important because it helps narrow down results efficiently.&lt;/p&gt;


&lt;h3&gt;
  
  
  4. How CASE WHEN helps in transforming data
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;CASE WHEN&lt;/strong&gt; statement allows us to create conditional logic inside SQL queries. It helps transform or categorize data thus making the data easier to understand and analyze.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example 1&lt;/code&gt;:&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;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;grade&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;marks&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="s1"&gt;'Distinction'&lt;/span&gt;
    &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="s1"&gt;'Merit'&lt;/span&gt;
    &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;marks&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="s1"&gt;'Pass'&lt;/span&gt;
    &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="s1"&gt;'Fail'&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;Performance&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, students are grouped into categories based on their marks with a new column created called &lt;code&gt;Performance&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example 2&lt;/code&gt;:&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;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'Minor'&lt;/span&gt;
        &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'Young Adult'&lt;/span&gt;
        &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="s1"&gt;'Adult'&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;age_group&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, students are grouped into categories based on their age with a new column created called &lt;code&gt;Age_group&lt;/code&gt;. &lt;/p&gt;




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

&lt;p&gt;• Every SQL statement must end with a &lt;strong&gt;semicolon ( ; )&lt;/strong&gt;&lt;br&gt;
• Text values must always be in &lt;strong&gt;single quotes&lt;/strong&gt; - 'Nairobi' &lt;br&gt;
• Numbers do &lt;strong&gt;NOT&lt;/strong&gt; need quotes - WHERE marks &amp;gt; 70 &lt;br&gt;
• Always use &lt;strong&gt;WHERE&lt;/strong&gt; with UPDATE and DELETE - without it, every row gets affected&lt;br&gt;
• Dates are written as &lt;strong&gt;'YYYY-MM-DD'&lt;/strong&gt; - e.g. '2024-03-15'&lt;br&gt;
• BETWEEN is &lt;strong&gt;inclusive&lt;/strong&gt; - BETWEEN 50 AND 80 includes 50 and 80 themselves &lt;br&gt;
• IN uses &lt;strong&gt;brackets and commas&lt;/strong&gt; - IN ('Nairobi', 'Mombasa') &lt;br&gt;
• LIKE patterns - 'A%' starts with A, '%Studies%' contains Studies &lt;br&gt;
• CASE WHEN always ends with &lt;strong&gt;END&lt;/strong&gt; - don't forget it! &lt;br&gt;
• Give your CASE WHEN result a name using &lt;strong&gt;AS&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Publish and Embed Power BI Reports on a Website: For Beginners</title>
      <dc:creator>Gracemunyi</dc:creator>
      <pubDate>Sat, 04 Apr 2026 11:52:22 +0000</pubDate>
      <link>https://dev.to/gracemunyi/how-to-publish-and-embed-your-first-power-bi-report-on-a-website-for-beginners-1lmm</link>
      <guid>https://dev.to/gracemunyi/how-to-publish-and-embed-your-first-power-bi-report-on-a-website-for-beginners-1lmm</guid>
      <description>&lt;p&gt;My next update is a simplified guide to publishing a Power BI report on the Web. I will walk you through every step from creating your first workspace to embedding a live interactive report on any website using an &lt;code&gt;iframe.&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;This guide is written for a &lt;strong&gt;complete beginner&lt;/strong&gt;. I assume you have never published a Power BI report before and may not even know what a workspace is yet. Every term and step will be explained in detail with a screenshot.&lt;/p&gt;

&lt;p&gt;By the end of this article you will know how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand what Power BI is and what you need before starting&lt;/li&gt;
&lt;li&gt;Create a workspace in the Power BI Service&lt;/li&gt;
&lt;li&gt;Upload and publish your report to the cloud&lt;/li&gt;
&lt;li&gt;Generate an embed code from Power BI&lt;/li&gt;
&lt;li&gt;Paste that embed code into any website using an HTML &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What is Power BI?&lt;/li&gt;
&lt;li&gt;What You Need Before You Start&lt;/li&gt;
&lt;li&gt;Step 1 — Sign In to the Power BI Service&lt;/li&gt;
&lt;li&gt;Step 2 — Create a Workspace&lt;/li&gt;
&lt;li&gt;Step 3 — Upload and Publish Your Report&lt;/li&gt;
&lt;li&gt;Step 4 — Embed the Report on Your Website and Generate the Embed Code &lt;/li&gt;
&lt;li&gt;Step 4 — Make it Responsive&lt;/li&gt;
&lt;li&gt;Step 6 — Delete or Revoke an Embed Code&lt;/li&gt;
&lt;li&gt;Key Takeaways&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What is Power BI?
&lt;/h2&gt;

&lt;p&gt;Power BI is a &lt;strong&gt;data visualization tool owned by Microsoft&lt;/strong&gt; that allows you to connect and extract data from various data sources such as databases, excel, web etc., in order to clean and transform the data then analyze it using &lt;strong&gt;interactive charts, graphs, and dashboards&lt;/strong&gt;.. This is  to answer the necessary business questions/goals. People can click, filter, and explore the dashboard live. &lt;/p&gt;

&lt;p&gt;The dashboards can then be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shared privately among organization employees&lt;/li&gt;
&lt;li&gt;Published publicly on the internet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embedded directly into a website&lt;/strong&gt;: which is what this guide is covering.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The two parts of Power BI you must know
&lt;/h3&gt;

&lt;p&gt;Power BI has two parts: &lt;strong&gt;Power Bi the desktop App&lt;/strong&gt; and &lt;strong&gt;Power BI Service&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;Part&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;What you use it for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power BI Desktop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A free Windows app you download and install in your laptop&lt;/td&gt;
&lt;td&gt;Building and designing your report&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power BI Service&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A website at &lt;code&gt;app.powerbi.com&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Publishing, sharing, and embedding your report&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  What is a .pbix file in Power BI?
&lt;/h3&gt;

&lt;p&gt;You must always save the data work you have been working on in Power BI Desktop. The data file saved will be in a format called *&lt;em&gt;.pbix"&lt;/em&gt;. Just like a saved Excel file format is ** .xlsx"". This is the file you upload to the cloud or share. If a colleague sends you a Power BI report by email it will almost always be a &lt;code&gt;.pbix&lt;/code&gt; file e.g &lt;code&gt;sales-report.pbix&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Steps to build a simple practice &lt;code&gt;.pbix&lt;/code&gt; file
&lt;/h4&gt;

&lt;p&gt;Open Power BI Desktop → click &lt;strong&gt;Enter data&lt;/strong&gt; → load some data e.g from excel → click &lt;strong&gt;Load&lt;/strong&gt; → click the &lt;strong&gt;bar chart icon&lt;/strong&gt; on the right &amp;gt; create some visualizations → go to &lt;strong&gt;File → Save as&lt;/strong&gt; → save it as &lt;code&gt;Your_name_practice_report.pbix&lt;/code&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is enough as an upload file to get you started on the uploading process.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You Need Before You Start
&lt;/h2&gt;

&lt;p&gt;Before starting the upload process, make sure you have all of these ready:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Why you need it&lt;/th&gt;
&lt;th&gt;Where to get it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power BI Desktop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To build and save your reports&lt;/td&gt;
&lt;td&gt;&lt;a href="https://powerbi.microsoft.com/desktop" rel="noopener noreferrer"&gt;Download free from Microsoft&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Microsoft work or school account&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Personal Gmail or Outlook accounts cannot publish reports&lt;/td&gt;
&lt;td&gt;Provided by your employer or school&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power BI Pro license&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Required to publish to workspaces and share reports&lt;/td&gt;
&lt;td&gt;Included in many Microsoft 365 plans, or activate a &lt;a href="https://powerbi.microsoft.com/power-bi-pro/" rel="noopener noreferrer"&gt;free 60-day trial&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A &lt;code&gt;.pbix&lt;/code&gt; report file&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The report you want to publish&lt;/td&gt;
&lt;td&gt;Built in Power BI Desktop&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Step 1 : Sign In to the Power BI Service
&lt;/h2&gt;

&lt;p&gt;The Power BI Service is the cloud website where publishing and embedding happens. You cannot design the reports here. Its only used for managing and sharing them with a larger audience team without requiring them to also download the Power Bi Desktop App. &lt;/p&gt;

&lt;h3&gt;
  
  
  How to sign in
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your web browser&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;&lt;a href="https://app.powerbi.com" rel="noopener noreferrer"&gt;https://app.powerbi.com&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Sign in&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Enter your &lt;strong&gt;work or school Microsoft email address&lt;/strong&gt; — for example &lt;code&gt;yourname@yourcompany.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enter your password and complete any two-factor authentication your organization requires.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Getting an error on sign-in?&lt;/strong&gt; Make sure you are using a work or school account, not a personal Microsoft account. If your company uses Single Sign-On (SSO), you may be redirected to your company login page first — that is normal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once signed in you will land on the &lt;strong&gt;Home&lt;/strong&gt; screen. On the left side you will see a vertical sidebar with icons labelled &lt;strong&gt;Home, Create, Browse, and Workspaces&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%2Flz4go4t9jjpss17c3gm7.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%2Flz4go4t9jjpss17c3gm7.png" alt="Home page " width="711" height="947"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create a Workspace
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is a workspace?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;workspace&lt;/strong&gt; is a folder in the Power BI cloud where your reports, datasets, and dashboards live. It is where you organize and share your work.&lt;/p&gt;

&lt;p&gt;By default Power BI gives every user a personal area called &lt;strong&gt;My workspace&lt;/strong&gt;. However, &lt;strong&gt;Reports stored in "My workspace" cannot be embedded on a website.&lt;/strong&gt; Thus, you must publish your report to a proper named &lt;strong&gt;workspaces&lt;/strong&gt; for embedding to work.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;My workspace&lt;/th&gt;
&lt;th&gt;A named workspace&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Who can see it&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Only you&lt;/td&gt;
&lt;td&gt;You and anyone you invite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Can embed reports&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Can share with others&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Requires Pro license&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Steps to create the Workspace
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In the left sidebar, click the &lt;strong&gt;Workspaces&lt;/strong&gt; icon. &lt;strong&gt;Workspaces&lt;/strong&gt; appear right above my Workspace as shown in the screenshot below&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A panel will slide out showing any existing workspaces.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; At the bottom of the panel, click &lt;strong&gt;+ New workspace&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%2Fsfmvhjbjtnh7sd6i0nhi.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%2Fsfmvhjbjtnh7sd6i0nhi.png" alt="Image 2" width="602" height="927"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; A settings panel will open on the right side of your screen. Fill in the following fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Workspace name&lt;/strong&gt; eg. your name, or project description like &lt;code&gt;Sales Reports 2026&lt;/code&gt; or &lt;code&gt;Marketing Dashboard&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Leave all other settings at their defaults for now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Click &lt;strong&gt;Save&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%2F8p5x3q51nkac9w1yfwho.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%2F8p5x3q51nkac9w1yfwho.png" alt="View of Workspacesin PowerBi Service" width="800" height="766"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your new workspace now appears in the left sidebar under Workspaces. Click on it to open it — it will be empty, but the next step fixes that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3 : Upload and Publish Your Report
&lt;/h2&gt;

&lt;p&gt;Publish from Power BI Desktop to the web service &lt;em&gt;(Most Recommended)&lt;/em&gt; as it is thefastest approach&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Open your report in &lt;strong&gt;Power BI Desktop&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2.&lt;/strong&gt; Sign in to Power Bi. Click &lt;strong&gt;Sign In&lt;/strong&gt; in the top right corner and enter the same email and password you use for the Power BI Service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Click the &lt;strong&gt;Home&lt;/strong&gt; tab in the ribbon at the top of the screen. Make sure you are on the Home tab and not on another tab like Insert or View.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Click the &lt;strong&gt;Publish&lt;/strong&gt; button on the far right side of the Home ribbon. &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%2F35bw5weztryn3f2dhq1c.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%2F35bw5weztryn3f2dhq1c.png" alt="Power BI Desktop application showing the Home tab and Publish button on the far right side highlighted in red box" width="800" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; A dialog box will appear titled &lt;strong&gt;"Publish to Power BI"&lt;/strong&gt; asking you to select a destination&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Click on the workspace you just created : e.g Your name or &lt;code&gt;Sales Reports 2026&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Choose your named workspace from the list. The report will be published there and will be ready for embedding.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please remember: &lt;strong&gt;Do not select My workspace.&lt;/strong&gt; If you publish to My workspace the report cannot be embedded. Always choose your named workspace.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Click &lt;strong&gt;Select&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Power BI Desktop will show a progress bar, then a green tick with the message &lt;strong&gt;"Success!"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; You can click &lt;strong&gt;Open &lt;code&gt;your-report-name&lt;/code&gt; in Power BI&lt;/strong&gt; in the success dialog to jump straight to the report in your browser, or close the dialog and continue with this guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; Confirm the report is there by refreshing Power Bi Service then Click my workspaces. The uploaded report will appear.&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%2Fu0jzsq69qba9kragbe1b.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%2Fu0jzsq69qba9kragbe1b.png" alt="Workspace name i created " width="800" height="599"&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%2Ftuzvizv4jbbqo0eymm7j.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%2Ftuzvizv4jbbqo0eymm7j.png" alt="Successful upload" width="740" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 : Embedding the report on a website.
&lt;/h2&gt;

&lt;p&gt;Power BI can generate a piece of HTML code called an &lt;strong&gt;iframe&lt;/strong&gt; that you paste into your website's code. This tells the browser to fetch and display the live &lt;code&gt;Sales Reports 2026&lt;/code&gt;report, allowing anyone who visits your website to view and interact with the report. &lt;/p&gt;

&lt;p&gt;Power BI offers several ways to embed a report. Here is what each one means:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Who can view it&lt;/th&gt;
&lt;th&gt;Best used for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Publish to web (public)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Anyone on the internet, no login required&lt;/td&gt;
&lt;td&gt;Public websites, blogs, news articles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Embed for your organization&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Only people signed in with your company account&lt;/td&gt;
&lt;td&gt;Internal tools, company intranets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SharePoint Online&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;People with access to your SharePoint site&lt;/td&gt;
&lt;td&gt;SharePoint intranet pages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Website or portal (secure)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Users authenticated via your app&lt;/td&gt;
&lt;td&gt;Custom web applications&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For this guide we will use &lt;strong&gt;Publish to web (public)&lt;/strong&gt;: the simplest and the right choice when learning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Please Note:&lt;/strong&gt; "Publish to web" makes your report visible to every person on the internet with no password and no login. &lt;strong&gt;Never use this with real business data, financial figures, personal information, or anything confidential.&lt;/strong&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Generate the Embed Code called an &lt;strong&gt;iframe&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Make sure your report is open in the Power BI Service. If it is not, go to your workspace and click on the report name to open it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Click &lt;strong&gt;File&lt;/strong&gt; (top-left area of the report look for the menu bar).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; In the dropdown, Hover over &lt;strong&gt;Embed report&lt;/strong&gt; and a sub menu will appear to the right&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Click &lt;strong&gt;Publish to web (public)&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;A dialogue box will appear with a warning, explaining that the report will be visible to anyone on the internet. Read it carefully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Then click &lt;strong&gt;Create embed code&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Making the Embed Responsive
&lt;/h2&gt;

&lt;p&gt;If a dialog pops up requesting you to contact the admin for access to enable publishing, close the dialog box then repeat 1,2 and 3. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Click &lt;strong&gt;Website or Portal&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%2Fut1ok8grj5m409t2a1va.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%2Fut1ok8grj5m409t2a1va.png" alt="Dialogue Box" width="800" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Copy the Iframe link that appears under &lt;strong&gt;HTML to paste on a website&lt;/strong&gt; box &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Go to your PC Desktop and Create a Folder. Name it &lt;strong&gt;Deploying&lt;/strong&gt; or &lt;strong&gt;Publishing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Open your &lt;strong&gt;Visual Studio code&lt;/strong&gt; App to the Welcome page&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8&lt;/strong&gt; Click Open Folder and select the Publishing folder you created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9&lt;/strong&gt; Once inside the folder, Navigate to the left side where the name Publishing appears, then Click &lt;strong&gt;New Open File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10&lt;/strong&gt; Name it ** Sample.html**  or &lt;strong&gt;Index.html&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%2Fwqhhgerhc9jyh3csn3yg.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%2Fwqhhgerhc9jyh3csn3yg.png" alt="VS Code File Creation " width="800" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11&lt;/strong&gt; Open the &lt;strong&gt;Index.html&lt;/strong&gt; file &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12&lt;/strong&gt; Go to W3Schools on your browser &lt;a href="https://www.w3schools.com/html/default.asp" rel="noopener noreferrer"&gt;W3Schools HTML Tutorial&lt;/a&gt; and open it &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13&lt;/strong&gt; Copy the whole code listed under &lt;strong&gt;Example&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%2F75joz9luazbmmsr4x5an.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%2F75joz9luazbmmsr4x5an.png" alt="W3School HTML" width="800" height="781"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14&lt;/strong&gt; Paste it in the VS Code file you created named &lt;strong&gt;index.html&lt;/strong&gt; and &lt;strong&gt;Save it&lt;/strong&gt; by Clicking &lt;strong&gt;Ctrl + S&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15&lt;/strong&gt; Go to the publishing folder that you created in your PC. An &lt;strong&gt;Explorer file&lt;/strong&gt; called &lt;strong&gt;Index&lt;/strong&gt; should be appear. &lt;br&gt;
&lt;strong&gt;16&lt;/strong&gt; Double click it. It will open in your browser. Copy the &lt;code&gt;URL&lt;/code&gt; that appears. Format is &lt;br&gt;
&lt;code&gt;file:///C:/User/User/Desktop/Publishing/Index.html&lt;/code&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%2F2kytuopabk9hrj8lr02y.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%2F2kytuopabk9hrj8lr02y.png" alt="Index URL" width="800" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17&lt;/strong&gt; Open a new Tab on your browser and paste the URL. Then click &lt;strong&gt;Enter.&lt;/strong&gt; . Our goal is to replace the &lt;strong&gt;This is a paragraph&lt;/strong&gt; text with your actual Power BI &lt;em&gt;Sales Report 2026&lt;/em&gt;*.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18&lt;/strong&gt; GO BACK to your Visual Studio Text editor you named Index.html. Then Delete line 9 of the W3School code that you paste there.ie &lt;code&gt;&amp;lt;p&amp;gt;This is a paragraph.&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20&lt;/strong&gt; Under line 9, Paste the HTML iframe code you had copied in &lt;em&gt;POINT 5&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21&lt;/strong&gt; Save the Changes by clicking &lt;em&gt;CTRL+S&lt;/em&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%2F79whc1zuf1q2nly793gc.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%2F79whc1zuf1q2nly793gc.png" alt="Iframe HTML code Saving" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22&lt;/strong&gt; Go back to your browser from point &lt;strong&gt;17&lt;/strong&gt; and refresh. Your Power BI Report should be loading. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24&lt;/strong&gt; Click &lt;strong&gt;Sign In&lt;/strong&gt; and log in using your &lt;strong&gt;Power BI Service log in details&lt;/strong&gt; as you have not yet given public access to your Power BI report.&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%2Ffwu2pbz7rh8c2k8ml62b.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%2Ffwu2pbz7rh8c2k8ml62b.png" alt="Web sign in" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25&lt;/strong&gt; Report will then load shortly. Below should be the type of view that you get.&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%2Ffs9qvamrsnj3au2x31cp.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%2Ffs9qvamrsnj3au2x31cp.png" alt="Embedded Power BI report" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 6 You can Delete or Revoke an Embed Code
&lt;/h2&gt;

&lt;p&gt;You can take a report offline at any time. Once you delete an embed code the report immediately stops showing on every website that uses it — no need to edit any HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to revoke an embed code:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the report in the Power BI Service&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;File&lt;/strong&gt; in the top-left menu bar&lt;/li&gt;
&lt;li&gt;Hover over &lt;strong&gt;Embed report&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Publish to web (public)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the dialog that appears, click &lt;strong&gt;"Manage embed codes"&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A list of all embed codes you have ever created will appear&lt;/li&gt;
&lt;li&gt;Find the one you want to remove and click the &lt;strong&gt;delete icon&lt;/strong&gt; (trash can) on the right&lt;/li&gt;
&lt;li&gt;Confirm the deletion&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Key point&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Power BI Desktop is for building reports. Power BI Service at &lt;code&gt;app.powerbi.com&lt;/code&gt; is for publishing and embedding them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;You can publish Power BI reports in the web for easier accessibility to a wider audience.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;You must publish to a &lt;strong&gt;named workspace&lt;/strong&gt;, not My workspace, for embedding to work.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Use &lt;strong&gt;Publish&lt;/strong&gt; from Power BI Desktop, or &lt;strong&gt;Upload&lt;/strong&gt; in the browser, to get your &lt;code&gt;.pbix&lt;/code&gt; file into the cloud.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Generate your iframe code via &lt;strong&gt;File → Embed report → Publish to web (public)&lt;/strong&gt; or ** Website &amp;amp; Publish**.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Publishing to web (public) means anyone on the internet can access it without any login required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Never embed real or sensitive data/reports&lt;/strong&gt; like company reports using Publish to web. Tt is visible to the entire internet with no password. Always publish as Embed for your organization, meaning only people signed in with your company account&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;You can &lt;strong&gt;revoke any embed code&lt;/strong&gt; at any time from the Manage embed codes screen, which immediately takes the report offline everywhere it was embedded.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;center&gt;

THE END

&lt;/center&gt;

</description>
      <category>powerfuldevs</category>
      <category>beginners</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding Data Modeling in Power BI: Joins, Relationships, and Schemas Explained</title>
      <dc:creator>Gracemunyi</dc:creator>
      <pubDate>Wed, 01 Apr 2026 09:45:56 +0000</pubDate>
      <link>https://dev.to/gracemunyi/understanding-data-modeling-in-power-bi-joins-relationships-and-schemas-explained-43of</link>
      <guid>https://dev.to/gracemunyi/understanding-data-modeling-in-power-bi-joins-relationships-and-schemas-explained-43of</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is a complete beginner guide covering:&lt;/p&gt;
&lt;h5&gt;
  
  
  A) SQL Joins &amp;amp; Power BI Relationships
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;SQL Joins
&lt;/li&gt;
&lt;li&gt;Power BI Relationships&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  B) Fact vs Dimension Tables, Star Schema, Snowflake Schema, and Common Concepts
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Fact Tables
&lt;/li&gt;
&lt;li&gt;Dimension Tables
&lt;/li&gt;
&lt;li&gt;Star Schema
&lt;/li&gt;
&lt;li&gt;Snowflake Schema
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  C) Modeling Issues
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Common Modeling Issues
&lt;/li&gt;
&lt;li&gt;Diagrams
&lt;/li&gt;
&lt;li&gt;SQL Code
&lt;/li&gt;
&lt;li&gt;Step-by-step Instructions&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h5&gt;
  
  
  Data Modeling Explained
&lt;/h5&gt;

&lt;p&gt;Lets say, a retail company has three tables: Sales, Customers, and Products. We require to model the data by organizing data tables and defining how they connect to each other so that every sale is linked to the right customer and the right product thus be able answer business questions accurately.   &lt;/p&gt;

&lt;h3&gt;
  
  
  1. SQL Joins
&lt;/h3&gt;

&lt;p&gt;A join combines rows from two tables based on a shared column. Before creating relationships in Power BI, understanding joins helps you know what data you are working with.&lt;/p&gt;

&lt;p&gt;We use two simple tables throughout all join examples below.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Table A — 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;id&lt;/th&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;country&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;Maria&lt;/td&gt;
&lt;td&gt;Germany&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;USA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Georg&lt;/td&gt;
&lt;td&gt;USA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Martin&lt;/td&gt;
&lt;td&gt;Germany&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;USA&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Table B - 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;order_id&lt;/th&gt;
&lt;th&gt;sales&lt;/th&gt;
&lt;th&gt;customer_id&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;$35&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;$20&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1004&lt;/td&gt;
&lt;td&gt;$10&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Peter and Martin have no orders. Order 1004 has customer_id 6 &lt;br&gt;
which does not exist in the customers table.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  INNER JOIN:Matching rows only
&lt;/h3&gt;

&lt;p&gt;Returns only rows where a match exists in &lt;strong&gt;both&lt;/strong&gt; tables. Peter, Martin, &lt;br&gt;
and Order 1004 are all excluded.&lt;/p&gt;

&lt;h4&gt;
  
  
  Venn diagram
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5d8cyt1s4iur77v23xin.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%2F5d8cyt1s4iur77v23xin.png" alt="Inner Join Venn Diagram" width="281" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;INNER JOIN = centre match only&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&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;o&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;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sales&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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="c1"&gt;-- Only rows matching in BOTH tables returned&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing INNER JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;c.id&lt;/th&gt;
&lt;th&gt;c.name&lt;/th&gt;
&lt;th&gt;o.order_id&lt;/th&gt;
&lt;th&gt;o.sales&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;Maria&lt;/td&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;$35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Georg&lt;/td&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;$20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Use INNER JOIN when you only want customers who have actually placed &lt;br&gt;
an order.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  LEFT JOIN: All from left, matched from right
&lt;/h3&gt;

&lt;p&gt;Returns &lt;strong&gt;all&lt;/strong&gt; rows from the left table. Where no match exists, NULL &lt;br&gt;
is shown.&lt;/p&gt;

&lt;h4&gt;
  
  
  Venn diagram
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmq9hvgo5zq49kuuo6sdk.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%2Fmq9hvgo5zq49kuuo6sdk.png" alt="Left Join Venn Diagram" width="303" height="227"&gt;&lt;/a&gt;&lt;br&gt;
   LEFT JOIN = entire left circle&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&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;o&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;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sales&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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="c1"&gt;-- All customers returned, NULL where no order exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing LEFT JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;c.id&lt;/th&gt;
&lt;th&gt;c.name&lt;/th&gt;
&lt;th&gt;o.order_id&lt;/th&gt;
&lt;th&gt;o.sales&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;Maria&lt;/td&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;$35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Georg&lt;/td&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;$20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Martin&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Use LEFT JOIN when you want all customers including those who havenever placed an order.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  RIGHT JOIN: All from right, matched from left
&lt;/h3&gt;

&lt;p&gt;Returns &lt;strong&gt;all&lt;/strong&gt; rows from the right table. Where no matching customer &lt;br&gt;
exists, NULL is shown.&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&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;o&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;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sales&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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="c1"&gt;-- All orders returned, NULL where no customer exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing RIGHT JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;c.id&lt;/th&gt;
&lt;th&gt;c.name&lt;/th&gt;
&lt;th&gt;o.order_id&lt;/th&gt;
&lt;th&gt;o.sales&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;Maria&lt;/td&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;$35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Georg&lt;/td&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;$20&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;1004&lt;/td&gt;
&lt;td&gt;$10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Most analysts prefer to swap tables and use LEFT JOIN.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  FULL OUTER JOIN: Everything from both tables
&lt;/h3&gt;

&lt;p&gt;Returns &lt;strong&gt;all&lt;/strong&gt; rows from both tables. Unmatched rows get NULL on the &lt;br&gt;
missing side.&lt;/p&gt;

&lt;h4&gt;
  
  
  Venn diagram
&lt;/h4&gt;

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

&lt;p&gt;FULL OUTER JOIN = both full circles&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&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;o&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;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sales&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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="c1"&gt;-- ALL rows from both tables, NULL on missing sides&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing FULL OUTER JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;c.id&lt;/th&gt;
&lt;th&gt;c.name&lt;/th&gt;
&lt;th&gt;o.order_id&lt;/th&gt;
&lt;th&gt;o.sales&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;Maria&lt;/td&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;$35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Georg&lt;/td&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;$20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Martin&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;NULL&lt;/td&gt;
&lt;td&gt;1004&lt;/td&gt;
&lt;td&gt;$10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  LEFT ANTI JOIN — unmatched from left only
&lt;/h3&gt;

&lt;p&gt;Returns only rows from the left table that have &lt;strong&gt;no match&lt;/strong&gt; in the &lt;br&gt;
right table.&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%2Fpudyqjls8azydpmvq05r.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%2Fpudyqjls8azydpmvq05r.png" alt="Left Anti Join Venn Diagram" width="320" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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;WHERE&lt;/span&gt; &lt;span class="n"&gt;o&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;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Only customers with NO matching order&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing LEFT ANTI JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;c.id&lt;/th&gt;
&lt;th&gt;c.name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Martin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Peter&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Use LEFT ANTI to answer: &lt;strong&gt;"Which customers have never placed an order?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  RIGHT ANTI JOIN : Unmatched from right only
&lt;/h3&gt;

&lt;p&gt;Returns only rows from the right table that have &lt;strong&gt;no match&lt;/strong&gt; in the left table.&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%2Fuprbq33dbvxtttlb9jja.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%2Fuprbq33dbvxtttlb9jja.png" alt="Right Anti Join Veen Diagram" width="295" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  SQL syntax
&lt;/h4&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;o&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;o&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;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sales&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;AS&lt;/span&gt; &lt;span class="k"&gt;c&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;AS&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&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;WHERE&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Only orders with NO matching customer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Result of merged tables after executing RIGHT ANTI JOIN
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;o.order_id&lt;/th&gt;
&lt;th&gt;o.customer_id&lt;/th&gt;
&lt;th&gt;o.sales&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1004&lt;/td&gt;
&lt;td&gt;6 (no match)&lt;/td&gt;
&lt;td&gt;$10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Use RIGHT ANTI for data quality checks: &lt;strong&gt;"Which orders have an &lt;br&gt;
invalid customer ID?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Joins in Power BI
&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;SQL Join / Power Query Merge&lt;/th&gt;
&lt;th&gt;Power BI Relationship&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What it does&lt;/td&gt;
&lt;td&gt;Physically combines rows into one table&lt;/td&gt;
&lt;td&gt;Keeps tables separate, filters flow between them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When it runs&lt;/td&gt;
&lt;td&gt;At data load time&lt;/td&gt;
&lt;td&gt;At query time when you click a slicer or visual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;Flat tables, one-off analysis&lt;/td&gt;
&lt;td&gt;Star schema models with slicers and visuals&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Simple rule:&lt;/strong&gt; Use a merge in Power Query when you need one combined &lt;br&gt;
table. Use a relationship in Model View when you want tables to filter &lt;br&gt;
each other in your report.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to create a join in Power Query — step by step
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open Power BI Desktop and load your tables&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Home&lt;/code&gt; → &lt;code&gt;Transform Data&lt;/code&gt; to open Power Query Editor&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;left table&lt;/strong&gt; (e.g. Customers) in the left panel&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Home&lt;/code&gt; → &lt;code&gt;Merge Queries&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;right table&lt;/strong&gt; (Orders), click the matching column in 
each table, then choose your join type from the dropdown&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; — a merged column appears. Click the expand icon to 
choose which columns to bring in&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Close and Apply&lt;/code&gt; to load the merged table back into Power BI&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Available join types in the Power Query dialog:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Left Outer (all from left). It is the most common&lt;/li&gt;
&lt;li&gt;Right Outer&lt;/li&gt;
&lt;li&gt;Full Outer&lt;/li&gt;
&lt;li&gt;Inner&lt;/li&gt;
&lt;li&gt;Left Anti&lt;/li&gt;
&lt;li&gt;Right Anti&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Relationships in Power BI keep tables separate but allow filters to flow between them. You manage them in &lt;strong&gt;Model View&lt;/strong&gt; or through the &lt;strong&gt;Manage Relationships&lt;/strong&gt; dialog.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of relationships
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;One-to-Many (1:M)&lt;/strong&gt;: Most common-One customer has many orders &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%2F118n1mkb62ya5hgv6hs9.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%2F118n1mkb62ya5hgv6hs9.png" alt="1-M" width="309" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many-to-Many (M:M)&lt;/strong&gt;: Many students take many courses&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%2Fgrsgpp4c1df7pe0ljzyv.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%2Fgrsgpp4c1df7pe0ljzyv.png" alt="M-M" width="277" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-One (1:1)&lt;/strong&gt;: Each employee has one profile |&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%2Ftvmwt4b6bu8aa2hoi599.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%2Ftvmwt4b6bu8aa2hoi599.png" alt="1-1" width="219" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-filter direction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single direction&lt;/strong&gt;: Filters flow one way, from dimension to fact 
table. Default and safest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both directions&lt;/strong&gt; :Filters flow both ways. Useful but can cause 
circular dependency issues if overused.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to create a relationship in Model View — step by step
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;Model View&lt;/strong&gt; icon on the left sidebar&lt;/li&gt;
&lt;li&gt;You will see all your tables displayed as boxes with their columns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drag&lt;/strong&gt; the &lt;code&gt;CustomerID&lt;/code&gt; column from the Customers table and 
&lt;strong&gt;drop&lt;/strong&gt; it onto &lt;code&gt;CustomerID&lt;/code&gt; in the Orders table&lt;/li&gt;
&lt;li&gt;A relationship line appears — &lt;strong&gt;1&lt;/strong&gt; on the Customers side, 
&lt;strong&gt;*&lt;/strong&gt; on the Orders side&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double-click&lt;/strong&gt; the line to edit cardinality, cross-filter 
direction, or active/inactive status
---&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Data Warehouse Schemas
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Fact Tables vs Dimension Tables
&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;Fact Table&lt;/th&gt;
&lt;th&gt;Dimension Table&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stores&lt;/td&gt;
&lt;td&gt;Measurable events&lt;/td&gt;
&lt;td&gt;Descriptive context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row count&lt;/td&gt;
&lt;td&gt;Many — can be millions&lt;/td&gt;
&lt;td&gt;Few — hundreds to thousands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contains&lt;/td&gt;
&lt;td&gt;Amounts, quantities, foreign keys&lt;/td&gt;
&lt;td&gt;Names, categories, dates, locations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Examples&lt;/td&gt;
&lt;td&gt;Sales, Orders, Transactions&lt;/td&gt;
&lt;td&gt;Customers, Products, Date, Location&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Simple rule:&lt;/strong&gt; If a table answers &lt;strong&gt;"how much or how many"&lt;/strong&gt; it is &lt;br&gt;
a Fact table. If it answers &lt;strong&gt;"who, what, when, or where"&lt;/strong&gt; it is a &lt;br&gt;
Dimension table.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Star Schema, Snowflake Schema, and Flat Table
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Flat table
&lt;/h4&gt;

&lt;p&gt;Everything in one single wide table. Easy to start but causes data duplication and incorrect totals when filtering.&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%2Fbqe4dy2laq4riv5jjz9i.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%2Fbqe4dy2laq4riv5jjz9i.png" alt="Flat Table " width="373" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Star schema: Recommended for Power BI
&lt;/h3&gt;

&lt;p&gt;Its is one central fact table directly connected to dimension tables. Simple, fast, and best for DAX and Power BI slicers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In a star schema, customer details live in one row only&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example of one in power bi&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%2F5c0h0ecv9ki87qeu11nv.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%2F5c0h0ecv9ki87qeu11nv.png" alt="Star" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps to build a star schema in Power BI
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Load your Fact table (Sales) and all Dimension tables into Power BI&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Model View&lt;/strong&gt; on the left sidebar&lt;/li&gt;
&lt;li&gt;Arrange the &lt;strong&gt;Fact table in the center&lt;/strong&gt; and Dimension tables 
around it&lt;/li&gt;
&lt;li&gt;Drag the foreign key in the Fact table to the primary key in each 
Dimension table to create a 1:M relationship&lt;/li&gt;
&lt;li&gt;Verify all lines show &lt;strong&gt;1&lt;/strong&gt; on the dimension side and &lt;strong&gt;*&lt;/strong&gt; on the fact side&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Snowflake schema
&lt;/h3&gt;

&lt;p&gt;Similar to a star schema but dimension tables are further broken into sub-tables. More complex and slower in Power BI. Only use snowflake if your data warehouse already uses this structure.&lt;/p&gt;

&lt;p&gt;Example of one in Powerbi &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%2F6kpucdz2toj7x6qx55n5.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%2F6kpucdz2toj7x6qx55n5.png" alt="Snowflake" width="725" height="380"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  When to use each schema
&lt;/h3&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;Use when&lt;/th&gt;
&lt;th&gt;Avoid when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Star&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Building any Power BI report&lt;/td&gt;
&lt;td&gt;Never avoid it. Always the default choice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Snowflake&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data warehouse already uses it&lt;/td&gt;
&lt;td&gt;Building a new model from scratch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flat table&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Quick one-off analysis on small data&lt;/td&gt;
&lt;td&gt;Data is updated regularly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

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

&lt;p&gt;&lt;strong&gt;Example: Orders fact table with three date columns:&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;Column&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OrderDateKey&lt;/td&gt;
&lt;td&gt;When the customer placed the order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ShipDateKey&lt;/td&gt;
&lt;td&gt;When the order was dispatched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeliveryDateKey&lt;/td&gt;
&lt;td&gt;When the customer received it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All three foreign keys point to the &lt;strong&gt;same Date dimension table&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to set this up in Power BI
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;strong&gt;one active relationship&lt;/strong&gt; from the Date table to 
&lt;code&gt;OrderDateKey&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;two inactive relationships&lt;/strong&gt; to &lt;code&gt;ShipDateKey&lt;/code&gt; and 
&lt;code&gt;DeliveryDateKey&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;USERELATIONSHIP()&lt;/code&gt; in your DAX measures to activate the 
right one:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ShippedRevenue =
CALCULATE(
    SUM(Sales[Amount]),
    USERELATIONSHIP(Date[DateKey], Sales[ShipDateKey])
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. Common Modeling Issues to Avoid
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Issue&lt;/th&gt;
&lt;th&gt;Why it is a problem&lt;/th&gt;
&lt;th&gt;How to fix it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Many-to-many relationships&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Causes duplicated totals&lt;/td&gt;
&lt;td&gt;Use a bridge table or restructure your model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bi-directional filters everywhere&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Creates circular dependencies&lt;/td&gt;
&lt;td&gt;Use single direction by default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;No dedicated Date table&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Time intelligence DAX will not work&lt;/td&gt;
&lt;td&gt;Always create a proper Date dimension table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flat table models&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data duplication causes wrong aggregations&lt;/td&gt;
&lt;td&gt;Switch to a star schema&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wrong cardinality direction&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Breaks filter propagation&lt;/td&gt;
&lt;td&gt;Put 1 on dimension side, * on fact side&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Calculated columns on fact tables&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Slows down large tables — stored in memory&lt;/td&gt;
&lt;td&gt;Use DAX measures instead&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  8. Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;star schema&lt;/strong&gt; as your default one fact table, dimensions 
around it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL joins&lt;/strong&gt; combine tables physically: &lt;strong&gt;relationships&lt;/strong&gt; keep them separate and filter across them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1:M relationships&lt;/strong&gt; are the most common and safest type in Power BI.&lt;/li&gt;
&lt;li&gt;Always create a &lt;strong&gt;dedicated Date table&lt;/strong&gt; for time intelligence&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;LEFT JOIN&lt;/strong&gt; keeps all rows from the left table including those with no match&lt;/li&gt;
&lt;li&gt;Avoid &lt;strong&gt;flat tables&lt;/strong&gt; and &lt;strong&gt;bi-directional filters&lt;/strong&gt; unless you have a specific reason.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;role-playing dimensions&lt;/strong&gt; when the same dimension table is needed multiple times in one fact table&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This was the second update on my learning journey to becoming a data engineer. If you found this helpful, feel comment on other areas of learning and improvement.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>discuss</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Scared of Linux as a Beginner Data Engineer? Here’s How to Get Started</title>
      <dc:creator>Gracemunyi</dc:creator>
      <pubDate>Mon, 30 Mar 2026 09:26:38 +0000</pubDate>
      <link>https://dev.to/gracemunyi/scared-of-linux-as-a-beginner-data-engineer-heres-how-to-get-started-3d4m</link>
      <guid>https://dev.to/gracemunyi/scared-of-linux-as-a-beginner-data-engineer-heres-how-to-get-started-3d4m</guid>
      <description>&lt;p&gt;If you're scared of Linux as a beginner data engineer, you're not alone. Almost everyone feels this way at the start. This year, I decided to transition from being a &lt;strong&gt;data analyst&lt;/strong&gt; to a &lt;strong&gt;data engineer&lt;/strong&gt; with zero Linux experience. &lt;/p&gt;

&lt;p&gt;Over the past two weeks, I’ve been learning practical Linux skills and how they apply to solving real world data problems for businesses. Here’s a summary of what I’ve learned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Firstly&lt;/strong&gt;, Every stage of the data engineering pipeline runs on Linux servers, usually in the cloud.&lt;/p&gt;

&lt;p&gt;As a data engineer, here’s what I’ll actually use Linux for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setting up and managing servers&lt;/strong&gt;: Configuring the machines 
where your data tools run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scheduling jobs&lt;/strong&gt;: Using CRON to trigger data pipelines 
automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging failures&lt;/strong&gt;: Connecting via SSH to investigate logs 
when a pipeline breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moving and managing files&lt;/strong&gt;: Handling raw data before it lands 
in storage like S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installing tools&lt;/strong&gt;: Setting up Python, Spark, Airflow, and 
other software on a server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring resources&lt;/strong&gt;: Checking server memory, disk usage, 
and overall health.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Secondly&lt;/strong&gt;: In real life, businesses pull data from APIs, databases, or external files daily. One has to automatically pull the data from these APIs using a Linux Server.&lt;/p&gt;

&lt;p&gt;To achieve this, one has learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect to a virtual Linux Server&lt;/li&gt;
&lt;li&gt;Manage files on the server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below are simplified steps to achieve this.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Connect to the Server via SSH and Update It
&lt;/h2&gt;

&lt;p&gt;SSH (Secure Shell) allowed me to open an encrypted terminal session to &lt;br&gt;
a remote server. I needed two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server's &lt;strong&gt;IP address&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;My &lt;strong&gt;username&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Windows, you can use &lt;strong&gt;PowerShell&lt;/strong&gt; or &lt;strong&gt;Git Bash&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I was using &lt;strong&gt;PowerShell&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Connect via SSH
&lt;/h2&gt;

&lt;p&gt;SSH (Secure Shell) opens an encrypted terminal session. You need your&lt;br&gt;
server's IP address and username.&lt;/p&gt;

&lt;p&gt;On Windows, use PowerShell or Git Bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh root@118.173.249.268
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Type &lt;code&gt;yes&lt;/code&gt; to accept the server key.&lt;/li&gt;
&lt;li&gt;Enter your password (it won't show).&lt;/li&gt;
&lt;li&gt;Press Enter, and you're in!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 2: Update the Server
&lt;/h2&gt;

&lt;p&gt;Always update your server first before doing anything else:&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;sudo &lt;/span&gt;apt update      &lt;span class="c"&gt;# Check for updates&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade     &lt;span class="c"&gt;# Install updates&lt;/span&gt;
&lt;span class="nb"&gt;pwd&lt;/span&gt;                  &lt;span class="c"&gt;# See your current directory&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt;                   &lt;span class="c"&gt;# List files and folders&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 3: Create Your Own User
&lt;/h2&gt;

&lt;p&gt;Avoid using root regularly by creating a personal user right after setup:&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;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;-m&lt;/span&gt; grace   &lt;span class="c"&gt;# Create user with home folder&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;passwd grace       &lt;span class="c"&gt;# Set password&lt;/span&gt;
&lt;span class="nb"&gt;logout&lt;/span&gt;                       &lt;span class="c"&gt;# Log out from root&lt;/span&gt;
ssh grace@118.173.249.268
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 4: Create Folders and Files
&lt;/h2&gt;

&lt;p&gt;Now that you are logged in as your own user, organize your workspace:&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;Project        &lt;span class="c"&gt;# Create a folder&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;Project           &lt;span class="c"&gt;# Enter the folder&lt;/span&gt;
&lt;span class="nb"&gt;touch &lt;/span&gt;main.py        &lt;span class="c"&gt;# Create a Python file&lt;/span&gt;
&lt;span class="nb"&gt;mkdir &lt;/span&gt;data           &lt;span class="c"&gt;# Create a sub-folder&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt;                   &lt;span class="c"&gt;# Verify folder and files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 5: Edit Files
&lt;/h2&gt;

&lt;p&gt;Use nano to write or paste your code into the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Paste your text or code&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + O&lt;/code&gt; to save&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + X&lt;/code&gt; to exit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;View file contents anytime with:&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;cat &lt;/span&gt;main.py
less main.py
more main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 6: Downloading file from webpage and Managing it
&lt;/h2&gt;

&lt;p&gt;Now that the workspace is set up, you can bring in data files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://example.com/data.csv      &lt;span class="c"&gt;# Download a file&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzf&lt;/span&gt; archive.tgz                   &lt;span class="c"&gt;# Extract compressed files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 7: Transfer Files Between Your Local PC and Server
&lt;/h2&gt;

&lt;p&gt;Move files from your local machine to the server using SCP&lt;br&gt;
(Secure Copy Protocol):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp main.py grace@118.173.249.268:/home/grace/from_local/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the server, navigate to the folder and run your script:&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;cd &lt;/span&gt;from_local
python3 main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary Takeaways as a beginner
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every tool in a data engineering pipeline runs on a Linux server to navigate, organize, and run tasks.&lt;/li&gt;
&lt;li&gt;SSH is your bridge between your PC and the server.&lt;/li&gt;
&lt;li&gt;Always update your server and create a personal user before anything else.&lt;/li&gt;
&lt;li&gt;Start small: create folders, files, and scripts, then automate tasks.&lt;/li&gt;
&lt;li&gt;Everything you do here mirrors real world data engineering work, like managing pipelines, logs, or datasets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re also learning Linux for data engineering,  what’s been challenging for you so far?. Drop a comment. I’d love to learn from your experience.&lt;/p&gt;

&lt;p&gt;Also, stay tuned for the next two weeks progress update.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>dataengineering</category>
      <category>beginners</category>
      <category>career</category>
    </item>
  </channel>
</rss>
