<?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: Kigen Tarus</title>
    <description>The latest articles on DEV Community by Kigen Tarus (@k1gen_).</description>
    <link>https://dev.to/k1gen_</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%2F3849415%2F42f3ee96-c043-428a-b3ff-1c9c35b892ec.png</url>
      <title>DEV Community: Kigen Tarus</title>
      <link>https://dev.to/k1gen_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/k1gen_"/>
    <language>en</language>
    <item>
      <title>SQL ARTICLE</title>
      <dc:creator>Kigen Tarus</dc:creator>
      <pubDate>Sun, 12 Apr 2026 12:30:22 +0000</pubDate>
      <link>https://dev.to/k1gen_/sql-article-jef</link>
      <guid>https://dev.to/k1gen_/sql-article-jef</guid>
      <description>&lt;h1&gt;
  
  
  Understanding DDL, DML, and SQL Operations in Practice
&lt;/h1&gt;

&lt;h2&gt;
  
  
  DDL vs. DML
&lt;/h2&gt;

&lt;p&gt;In SQL, commands are broadly divided into two categories: &lt;strong&gt;Data Definition Language (DDL)&lt;/strong&gt; and &lt;strong&gt;Data Manipulation Language (DML).&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DDL&lt;/strong&gt; defines and structures the database. It includes commands like &lt;code&gt;CREATE&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt;, &lt;code&gt;DROP&lt;/code&gt;, and &lt;code&gt;RENAME&lt;/code&gt;. These commands shape the schema, tables, and columns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DML&lt;/strong&gt; works with the actual data inside those structures. It includes &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;, and &lt;code&gt;SELECT&lt;/code&gt;. These commands add, modify, remove, or query records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference is clear: DDL sets up the “blueprint” of the database, while DML fills and manages the “content.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Applying CREATE, INSERT, UPDATE, and DELETE
&lt;/h2&gt;

&lt;p&gt;In the Nairobi Academy assignment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CREATE&lt;/strong&gt; was used to build the schema (&lt;code&gt;CREATE SCHEMA nairobi_academy&lt;/code&gt;) and tables (&lt;code&gt;students&lt;/code&gt;, &lt;code&gt;subjects&lt;/code&gt;, &lt;code&gt;exam_results&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;INSERT&lt;/strong&gt; populated the tables with 10 students, 10 subjects, and 10 exam results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UPDATE&lt;/strong&gt; modified specific records, such as changing Esther Akinyi’s city from Nakuru to Nairobi and adjusting exam marks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DELETE&lt;/strong&gt; removed unwanted data, like cancelling exam result ID 9.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These commands show the lifecycle of data: creation, insertion, adjustment, and removal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filtering with WHERE
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;WHERE&lt;/code&gt; clause is the backbone of SQL queries. It filters results based on conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;=&lt;/code&gt; finds exact matches (e.g., students in Form 4).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;&lt;/code&gt; compares values (e.g., marks greater than 70).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BETWEEN&lt;/code&gt; checks ranges (e.g., marks between 50 and 80).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IN&lt;/code&gt; and &lt;code&gt;NOT IN&lt;/code&gt; test membership (e.g., students from Nairobi, Mombasa, or Kisumu).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LIKE&lt;/code&gt; searches patterns (e.g., names starting with “A” or “E”).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This flexibility makes &lt;code&gt;WHERE&lt;/code&gt; essential for precise data retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  CASE WHEN for Transformation
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;CASE WHEN&lt;/code&gt; statement adds logic to queries, transforming raw data into meaningful categories. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exam results were labeled as &lt;strong&gt;Distinction, Merit, Pass, or Fail&lt;/strong&gt; based on marks.&lt;/li&gt;
&lt;li&gt;Students were classified as &lt;strong&gt;Senior&lt;/strong&gt; (Form 3 &amp;amp; 4) or &lt;strong&gt;Junior&lt;/strong&gt; (Form 1 &amp;amp; 2).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feature turns numbers and codes into human‑readable insights, making reports more useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;Working through this assignment highlighted how SQL is both technical and practical. The &lt;strong&gt;DDL tasks&lt;/strong&gt; were straightforward—building tables felt like laying a foundation. The &lt;strong&gt;DML tasks&lt;/strong&gt; required more attention, especially ensuring data consistency when updating or deleting records. The most interesting part was using &lt;code&gt;CASE WHEN&lt;/code&gt;, because it showed how SQL can go beyond storage and retrieval to provide analysis and interpretation. The challenge was remembering the exact syntax for altering and renaming columns, but once mastered, it felt empowering to reshape the database structure mid‑stream.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Publishing and Embedding Power BI Reports</title>
      <dc:creator>Kigen Tarus</dc:creator>
      <pubDate>Sun, 05 Apr 2026 13:43:48 +0000</pubDate>
      <link>https://dev.to/k1gen_/publishing-and-embedding-power-bi-reports-21p3</link>
      <guid>https://dev.to/k1gen_/publishing-and-embedding-power-bi-reports-21p3</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;By: Tarus Kigen&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To publish a Power BI report and embed it into a website, you’ll use Power BI Service to upload your report, generate an embed code, and paste it into your site. This makes your interactive dashboards viewable directly in a browser.&lt;/strong&gt;  &lt;/p&gt;




&lt;p&gt;&lt;u&gt;# 🖥 Introduction to Power BI Publishing&lt;/u&gt;&lt;br&gt;
Power BI is Microsoft’s business analytics tool that lets you create interactive reports and dashboards. Once you’ve built a report in &lt;strong&gt;Power BI Desktop&lt;/strong&gt;, you can publish it to the &lt;strong&gt;Power BI Service (app.powerbi.com)&lt;/strong&gt; and share it with others. One powerful feature is embedding reports into websites, allowing stakeholders to interact with live data without needing Power BI installed.&lt;/p&gt;




&lt;p&gt;&lt;u&gt;# 📌 Step 1: Create a Workspace&lt;/u&gt;&lt;br&gt;
A workspace is a collaborative area in Power BI Service where reports and dashboards are stored.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;app.powerbi.com&lt;/strong&gt; and sign in.
&lt;/li&gt;
&lt;li&gt;On the left panel, click &lt;strong&gt;Workspaces → Create a workspace&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Name your workspace and configure access permissions.
&lt;/li&gt;
&lt;li&gt;Save it. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;# 📌 Step 2: Upload and Publish Your Report&lt;/u&gt;&lt;br&gt;
Once your workspace is ready, upload your report from Power BI Desktop.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;Power BI Desktop&lt;/strong&gt;, click &lt;strong&gt;File → Publish → Publish to Power BI&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Select your workspace.
&lt;/li&gt;
&lt;li&gt;The report will appear in your online workspace.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;# 📌 Step 3: Generate the Embed Code&lt;/u&gt;&lt;br&gt;
Now you’ll create the code snippet that allows embedding.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Power BI Service, open your report.
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;File → Publish to web&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;A dialog box will appear with an &lt;strong&gt;embed code&lt;/strong&gt; (iframe HTML).
&lt;/li&gt;
&lt;li&gt;Copy the code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Publish to web makes your report public. Anyone with the link can view it, so avoid using confidential data. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;# 📌 Step 4: Embed the Report on a Website&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your website’s HTML editor.
&lt;/li&gt;
&lt;li&gt;Paste the embed code where you want the report to appear.
&lt;/li&gt;
&lt;li&gt;Save and refresh your site.
&lt;/li&gt;
&lt;li&gt;The interactive Power BI report will now be visible to visitors.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;# 🔑 Key Insights&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Workspaces&lt;/strong&gt; organize reports and control access.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publishing&lt;/strong&gt; moves your report from Desktop to the cloud.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embed codes&lt;/strong&gt; allow integration into websites, but they make reports public.
&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;secure embedding&lt;/strong&gt;, use Power BI Embedded or organizational sharing instead of “Publish to web.”
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;✅ With these steps, you can take your Power BI dashboards beyond the app and make them accessible directly on your website, enabling interactive data exploration for your audience.&lt;br&gt;&lt;br&gt;
Feel free to leave any questions in the comments. Thank you for your time.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Data Modeling in Power BI: Joins, Relationships, and Schemas Explained</title>
      <dc:creator>Kigen Tarus</dc:creator>
      <pubDate>Sun, 29 Mar 2026 15:24:42 +0000</pubDate>
      <link>https://dev.to/k1gen_/understanding-data-modeling-in-power-bi-joins-relationships-and-schemas-explained-2k10</link>
      <guid>https://dev.to/k1gen_/understanding-data-modeling-in-power-bi-joins-relationships-and-schemas-explained-2k10</guid>
      <description>&lt;p&gt;By Tarus Kigen &lt;br&gt;
Student Analyst*&lt;/p&gt;

&lt;p&gt;Hello there. My name is Tarus, I thought Power BI was just about dragging colorful charts onto a canvas. I was wrong.&lt;/p&gt;

&lt;p&gt;After getting lost in a mess of incorrect totals and weird filters, I realized the most important thing isn't visuals—it's &lt;strong&gt;data modeling&lt;/strong&gt;. If your model is wrong, nothing works. So, I spent my week breaking down joins, relationships, and schemas. Let me share what I learned in simple terms.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;u&gt;What is Data Modeling?&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Imagine building a house. You don't throw bricks, wood, and glass into a pile and call it a home. You &lt;em&gt;organize&lt;/em&gt; them into walls, floors, and a roof. &lt;strong&gt;Data modeling&lt;/strong&gt; is the same: organizing your raw data into a logical structure that Power BI can understand quickly and correctly.&lt;/p&gt;

&lt;p&gt;Good data modeling = Fast reports + Correct numbers + Happy boss.&lt;/p&gt;
&lt;h2&gt;
  
  
  SQL Joins vs. Power BI Relationships (Key Difference!)
&lt;/h2&gt;

&lt;p&gt;This confused me the most. In SQL databases, &lt;strong&gt;joins&lt;/strong&gt; physically combine two tables into &lt;em&gt;one&lt;/em&gt; new table. In Power BI, &lt;strong&gt;relationships&lt;/strong&gt; leave the tables separate but "connect" them temporarily when you make a visual.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Join&lt;/strong&gt; (Power Query): Permanently merges columns from two tables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relationship&lt;/strong&gt; (Model View): A flexible link that respects table independence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You use &lt;em&gt;joins&lt;/em&gt; when cleaning data in Power Query. You use &lt;em&gt;relationships&lt;/em&gt; when building models in Model View.&lt;/p&gt;
&lt;h2&gt;
  
  
  All SQL Joins Explained (As I Learned in Power Query)
&lt;/h2&gt;

&lt;p&gt;I practiced these using &lt;strong&gt;Merge Queries&lt;/strong&gt; in Power Query Editor (Home → Combine → Merge Queries). Here is my cheat sheet using two imaginary tables:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table A: Students&lt;/strong&gt; (StudentID, Name)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Table B: Grades&lt;/strong&gt; (StudentID, Score)&lt;/p&gt;
&lt;h3&gt;
  
  
  1. INNER JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Give me students who have grades."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Only rows where StudentID exists in &lt;em&gt;both&lt;/em&gt; tables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Listing only active employees who already completed training.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagram&lt;/strong&gt;: Two overlapping circles → only the middle.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. LEFT OUTER JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Give me ALL students, plus grades if they exist."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Every row from left table (Students). Grades = NULL if missing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Customer list with order amounts (show customers even if they never ordered).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagram&lt;/strong&gt;: Left circle completely + overlapping middle.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3. RIGHT OUTER JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Give me ALL grades, plus student names if they exist."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Every row from right table (Grades). Name = NULL if missing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Transaction list showing unknown user IDs. (Honestly? You can just swap tables and use LEFT JOIN).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4. FULL OUTER JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Everyone and everything, matched where possible."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: All rows from both tables. NULLs where no match.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Merging two customer lists from different acquisitions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagram&lt;/strong&gt;: Both circles fully merged.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  5. LEFT ANTI JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Students who have NO grades."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Only rows in left table with no match in right.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Finding products that were never sold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagram&lt;/strong&gt;: Left circle minus the middle overlap.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  6. RIGHT ANTI JOIN
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Grades with no student record."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Orphaned records in the right table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life&lt;/strong&gt;: Detecting database integrity issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where to make joins in Power BI&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
&lt;em&gt;Power Query Editor → Select first table → Merge Queries → Select second table → Choose join kind.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Power BI Relationships (Model View)
&lt;/h2&gt;

&lt;p&gt;After loading tables, go to &lt;strong&gt;Model View&lt;/strong&gt; (left sidebar). Drag a field from one table to another to create a relationship. Here is what each setting means:&lt;/p&gt;
&lt;h3&gt;
  
  
  Cardinality (1:M, M:M, 1:1)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1:M (One to Many)&lt;/strong&gt;: One product has many sales. &lt;strong&gt;This is 90% of your relationships.&lt;/strong&gt; One row in the "one" side filters many rows on the "many" side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1:1&lt;/strong&gt;: One user has one passport. Rare. Use if splitting a wide table into two thin ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;M:M (Many to Many)&lt;/strong&gt;: Students have many classes, classes have many students. &lt;em&gt;Warning&lt;/em&gt;: Use carefully, or totals will double.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Cross-Filter Direction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single (Default)&lt;/strong&gt;: Filters flow from "one" side to "many" side. You pick a date table, it filters sales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both&lt;/strong&gt;: Filters flow both ways. Only use when you know what you are doing (otherwise, ambiguous paths occur).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Active vs. Inactive Relationships
&lt;/h3&gt;

&lt;p&gt;You can have multiple relationships between two tables (e.g., Sales table has OrderDate and ShipDate both linked to a Date table). But only &lt;strong&gt;one active&lt;/strong&gt; at a time. Use &lt;code&gt;USERELATIONSHIP&lt;/code&gt; in DAX to activate an inactive one.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fact vs. Dimension Tables (The Golden Rule)
&lt;/h2&gt;

&lt;p&gt;After my week, I finally understood this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Fact Table&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Dimension Table&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Contains measurements (Sales Amount, Quantity)&lt;/td&gt;
&lt;td&gt;Contains descriptions (Product Name, Customer City)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Changes often (every transaction)&lt;/td&gt;
&lt;td&gt;Changes slowly (customer address)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Has foreign keys (ProductID, CustomerID)&lt;/td&gt;
&lt;td&gt;Has primary keys (ProductID)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Example: &lt;code&gt;Sales&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Example: &lt;code&gt;Products&lt;/code&gt;, &lt;code&gt;Customers&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Rule&lt;/strong&gt;: Fact tables are at the "many" side of relationships. Dimensions are at the "one" side.&lt;/p&gt;
&lt;h2&gt;
  
  
  Schemas: Star, Snowflake, and Flat Table (DLAT)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Star Schema (The Winner)
&lt;/h3&gt;

&lt;p&gt;One fact table in the middle, dimension tables directly connected like a star.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why I love it&lt;/strong&gt;: Simple, fast, easy for beginners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case&lt;/strong&gt;: Most business reports (sales, inventory, HR).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. Snowflake Schema
&lt;/h3&gt;

&lt;p&gt;Dimensions are &lt;em&gt;further normalized&lt;/em&gt; into sub-dimensions (e.g., Product → Category → CategoryType).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why avoid as a beginner&lt;/strong&gt;: Slower, more complex.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case&lt;/strong&gt;: Huge enterprise databases where storage is critical.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3. Flat Table (Denormalized, aka DLAT – "Don't Look At That")
&lt;/h3&gt;

&lt;p&gt;One giant table with everything (fact + dimensions combined).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why not&lt;/strong&gt;: Huge file size, repeating data, difficult filtering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case&lt;/strong&gt;: Simple exports for small data (&amp;lt;100k rows). I started here and regretted it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Role-Playing Dimensions
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;date table&lt;/strong&gt; that filters sales by OrderDate, then by ShipDate, then by DueDate. Same dimension table, used many ways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to create&lt;/strong&gt;: Build one Date table, create inactive relationships for secondary dates. Use measures like:&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="n"&gt;Sales&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;Ship&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;CALCULATE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sales&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Amount&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt; &lt;span class="n"&gt;USERELATIONSHIP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sales&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ShipDate&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;[&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;h2&gt;
  
  
  Common Modeling Issues I Faced (And Fixed)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Bidirectional filters causing ambiguity&lt;/strong&gt; → Set cross-filter to Single.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Many-to-many giving wrong totals&lt;/strong&gt; → Add a bridge table (e.g., &lt;code&gt;StudentClass&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blank rows appearing in slicers&lt;/strong&gt; → Fix foreign key mismatches (orphan rows).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circular dependencies&lt;/strong&gt; → Remove redundant relationships.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step-by-Step: Where to Create These 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;&lt;strong&gt;Task&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Where in Power BI&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Merge two tables (JOIN)&lt;/td&gt;
&lt;td&gt;Power Query Editor → Merge Queries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create a relationship&lt;/td&gt;
&lt;td&gt;Model View → Drag field to field&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change cardinality&lt;/td&gt;
&lt;td&gt;Model View → Manage Relationships → Edit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Activate/inactivate relationship&lt;/td&gt;
&lt;td&gt;Model View → Click line → Uncheck "Active"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;View schema&lt;/td&gt;
&lt;td&gt;Model View (zoom out to see all tables)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create a flat table&lt;/td&gt;
&lt;td&gt;Power Query → Append Queries (stack) or Merge (widen)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final Advice
&lt;/h2&gt;

&lt;p&gt;Start with a &lt;strong&gt;star schema&lt;/strong&gt;: one fact table, a few dimensions. Use &lt;strong&gt;1:M relationships&lt;/strong&gt; with single filter direction. Avoid many-to-many. Use &lt;strong&gt;joins only in Power Query&lt;/strong&gt; to clean data (e.g., adding lookup values), then use &lt;strong&gt;relationships&lt;/strong&gt; for reporting.&lt;/p&gt;

&lt;p&gt;After one week, my reports no longer lie. Yours will too. Happy modeling.&lt;/p&gt;

&lt;p&gt;*— Tarus Kigen, Student Analyst.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>beginners</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
