<?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: samwel</title>
    <description>The latest articles on DEV Community by samwel (@mainaa).</description>
    <link>https://dev.to/mainaa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3955267%2Feb8ddbce-1912-4df2-9baf-6f3e013c3fce.png</url>
      <title>DEV Community: samwel</title>
      <link>https://dev.to/mainaa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mainaa"/>
    <language>en</language>
    <item>
      <title>Fact Tables, Star Schemas, Joins and Dashboards</title>
      <dc:creator>samwel</dc:creator>
      <pubDate>Mon, 06 Jul 2026 21:56:50 +0000</pubDate>
      <link>https://dev.to/mainaa/fact-tables-star-schemas-joins-and-dashboards-44mm</link>
      <guid>https://dev.to/mainaa/fact-tables-star-schemas-joins-and-dashboards-44mm</guid>
      <description>&lt;p&gt;When I first heard the words &lt;strong&gt;star schema&lt;/strong&gt;, &lt;strong&gt;fact table&lt;/strong&gt; and &lt;strong&gt;DAX&lt;/strong&gt;, I honestly had no idea what any of that meant. It sounded like something only data scientists with ten years of experience would understand. But here I am, a few classes in, and I can actually say I get it now.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Flat Tables&lt;/em&gt;&lt;br&gt;
The first thing I learned is that most data you get in the real world comes as one big flat table. Think of it like a school register where everything is on one sheet: student name, class, teacher name, subject, marks, county—all in one row.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact Tables and Dimension Tables&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Simple rule&lt;/em&gt; : if a column has a number you would SUM or AVERAGE, it belongs in the fact table. If it is a description or label that repeats, it belongs in a dimension table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Star Schema vs Snowflake Schema&lt;/strong&gt;&lt;br&gt;
Once you have split your flat table into fact and dimension tables, you have a star schema. The fact table sits in the middle; dimension tables surround it just like a star.&lt;/p&gt;

&lt;p&gt;My instructor also introduced the snowflake schema, which is where dimension tables get split further into even smaller tables. I like to think of it this way:&lt;br&gt;
A star schema is like keeping everything about a customer in one folder. Snowflake schema is like splitting that folder into sub-folders inside sub-folders.&lt;br&gt;
For Power BI, stick with the star schema. It is simpler and faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relationships — Connecting the Tables&lt;/strong&gt;&lt;br&gt;
After splitting your data into multiple tables, you need to connect them. That connection is called a relationship.&lt;/p&gt;

&lt;p&gt;Every relationship works because two tables share a common column usually an ID. Like CustomerID appearing in both the Sales table and the Customer table. That shared column is the bridge.&lt;br&gt;
The most common relationship is one-to-many (1:*) — one customer can have many purchases. One product can appear in many sales. In Power BI's model view, you just drag the shared column from one table to the other, and Power BI draws the line for you.&lt;br&gt;
Once your relationships are set up, you can build charts using columns from different tables without manually joining anything. Power BI handles it behind the scenes.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Joins—Merge Queries in Power Query&lt;/u&gt;&lt;br&gt;
Before I understood relationships, I was using Merge Queries to combine tables. Power BI gives you six join types:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Inner join&lt;/em&gt; — only rows that match in both tables&lt;br&gt;
Left outer join — all rows from the left table, nulls where there is no match&lt;br&gt;
&lt;em&gt;Right outer join&lt;/em&gt; — all rows from the right table&lt;br&gt;
&lt;em&gt;Full outer join&lt;/em&gt; — every row from both tables&lt;br&gt;
&lt;em&gt;Left anti join&lt;/em&gt; — rows from the left table with NO match (great for finding missing data)&lt;br&gt;
&lt;em&gt;Right anti join&lt;/em&gt; — rows from the right table with NO match&lt;br&gt;
The one that surprised me most was the anti join. I used it to find customers who had never made a purchase—you just put the Customers table on the left, Sales on the right, pick Left Anti, and boom—only the customers with no orders show up.&lt;br&gt;
**&lt;br&gt;
Charts and Dashboards**&lt;br&gt;
 After all the data modelling work, you finally get to build something visual.&lt;br&gt;
Here is what I learned about each chart type:&lt;br&gt;
&lt;em&gt;Column and bar&lt;/em&gt; charts are for comparing categories. A column goes up and down, and a bar goes left and right. Use a bar when your category names are long; they have more room.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Line and Area charts&lt;/em&gt; are for showing trends over time. Always put your date on the X axis. An area chart is just a line chart with the space below filled in, good for showing volume.&lt;/p&gt;

&lt;p&gt;_Pie and donut charts show proportions—parts of a whole. Keep it to five categories or less; otherwise, the slices become too small to read. A donut is the same thing with a hole in the middle where you can put a summary number.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A treemap&lt;/em&gt; is like a pie chart but uses rectangles. Better when you have many categories.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A funnel chart&lt;/em&gt; shows a step-by-step process where numbers drop off at each stage, like patients moving from diagnosis to treatment to discharge.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A combo&lt;/em&gt; chart combines a bar chart and a line chart in one visual. Useful when you are comparing two measures with very different scales.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The card&lt;/em&gt; is just one big number on the screen. I put these at the top of my dashboard total visits, total revenue, and average satisfaction score. Like a scoreboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My First Dashboard&lt;/strong&gt;&lt;br&gt;
The first dashboard I built was on Kenya crops data  showing yield, profit, cost of production, and revenue broken down by county and season.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Everything I Learned About Power BI From Zero to Actually Understanding DAX</title>
      <dc:creator>samwel</dc:creator>
      <pubDate>Wed, 01 Jul 2026 00:28:28 +0000</pubDate>
      <link>https://dev.to/mainaa/everything-i-learned-about-power-bifrom-zero-to-actually-understanding-dax-31cg</link>
      <guid>https://dev.to/mainaa/everything-i-learned-about-power-bifrom-zero-to-actually-understanding-dax-31cg</guid>
      <description>&lt;p&gt;&lt;strong&gt;What Even Is Power BI?&lt;/strong&gt;&lt;br&gt;
Power BI is a data visualization and business intelligence tool by Microsoft. You use it to connect to data, clean it, analyze it, and build dashboards and reports.&lt;br&gt;
&lt;strong&gt;Power Query&lt;/strong&gt;&lt;br&gt;
Before you can analyze anything, your data needs to be clean. Power Query is the tool inside Power BI where you do all that cleaning&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAX&lt;/strong&gt;-Data Analysis Expressions&lt;br&gt;
The Formula Language of Power BI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measures vs Calculated Columns&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;A calculated column&lt;/em&gt; adds a new column to your table. It calculates a value per row and stores it there permanently&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A Measure calculates&lt;/em&gt; a single value on the fly based on whatever filters are currently applied&lt;br&gt;
    &lt;em&gt;SUM vs SUMX&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;SUM **just adds up values in a single existing column. **SUMX&lt;/strong&gt; goes row by row, does a calculation per row, then adds all the results together.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;&lt;em&gt;Math Functions&lt;/em&gt;&lt;/strong&gt; 
&lt;strong&gt;ABS&lt;/strong&gt;-Absolute Value
ABS removes the negative sign and always returns a positive number&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;ROUND, ROUNDUP, ROUNDDOWN&lt;/strong&gt;&lt;br&gt;
ROUND goes to nearest. ROUNDUP always goes up. ROUNDDOWN always goes down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MOD&lt;/strong&gt;&lt;br&gt;
Remainder After Division-MOD gives you the leftover after dividing two numbers. Most common use is checking even or odd numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Text Functions&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;CONCATENATE and the &amp;amp; Operator&lt;/strong&gt;&lt;br&gt;
CONCATENATE joins two text values but only takes two arguments. The &amp;amp; operator has no limit and is cleaner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LEFT, RIGHT, MID&lt;/strong&gt;&lt;br&gt;
LEFT extracts from the start. RIGHT extracts from the end. MID extracts from the middle.&lt;br&gt;
    &lt;strong&gt;&lt;em&gt;Logical Functions&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;IF&lt;/strong&gt;&lt;br&gt;
IF always needs exactly three parts separated by commas the condition, result if true, result if false.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AND, OR, &amp;amp;&amp;amp;, ||&lt;/strong&gt;&lt;br&gt;
AND and OR only accept two conditions. Use &amp;amp;&amp;amp; and || when you need more than two&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SWITCH(TRUE())&lt;/strong&gt;&lt;br&gt;
SWITCH is cleaner than nested IFs. SWITCH(TRUE()) lets you use conditions inside SWITCH&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ISBLANK&lt;/strong&gt;&lt;br&gt;
ISBLANK checks if a cell is truly empty — not zero, but empty. Blank is NOT the same as zero.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;CALCULATE&lt;/strong&gt;&lt;/em&gt; — &lt;em&gt;The Most Powerful DAX Function&lt;/em&gt;&lt;br&gt;
CALCULATE lets you calculate something with a filter applied&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;ALL, REMOVEFILTERS and ALLEXCEPT&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ALL removes all filters and forces Power BI to look at the entire dataset even if a slicer is active. REMOVEFILTERS does the exact same thing with a clearer name.&lt;/p&gt;

&lt;p&gt;ALLEXCEPT removes all filters except the ones you specify&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Date Functions&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
TODAY() — Returns today's date&lt;br&gt;
NOW() — Returns today's date and time&lt;br&gt;
YEAR([Date]) — Extracts the year&lt;br&gt;
MONTH([Date]) — Extracts the month number&lt;br&gt;
DAY([Date]) — Extracts the day number&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;COUNT vs COUNTA&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
COUNT only counts numeric values. COUNTA counts everything that is not blank numbers, text, dates.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>beginners</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Everything I Learned About Power BI — From Zero to Actually Understanding DAX</title>
      <dc:creator>samwel</dc:creator>
      <pubDate>Tue, 30 Jun 2026 21:34:42 +0000</pubDate>
      <link>https://dev.to/mainaa/everything-i-learned-about-power-bi-from-zero-to-actually-understanding-dax-3a63</link>
      <guid>https://dev.to/mainaa/everything-i-learned-about-power-bi-from-zero-to-actually-understanding-dax-3a63</guid>
      <description>&lt;p&gt;&lt;strong&gt;What Even Is Power BI?&lt;/strong&gt;&lt;br&gt;
Power BI is a data visualization and business intelligence tool by Microsoft. You use it to connect to data, clean it, analyze it, and build dashboards and reports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Power BI vs Excel&lt;/strong&gt;&lt;br&gt;
Excel makes you do the work every time something changes. Power BI does the work for you automatically&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Power Query&lt;/strong&gt;&lt;br&gt;
Before you can analyze anything, your data needs to be clean. Power Query is the tool inside Power BI where you do all that cleaning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;DAX — The Formula Language of Power BI&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
DAX stands for Data Analysis Expressions. It is the formula language of Power BI. Everything you write in the formula bar in Power BI is DAX.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measures vs Calculated Columns&lt;/strong&gt;&lt;br&gt;
A Calculated Column adds a new column to your table. It calculates a value per row and store there permanently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpd9qio5z7l45l7d8gaqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpd9qio5z7l45l7d8gaqt.png" alt=" " width="685" height="40"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DAY 1</title>
      <dc:creator>samwel</dc:creator>
      <pubDate>Thu, 28 May 2026 06:00:56 +0000</pubDate>
      <link>https://dev.to/mainaa/day-1-3152</link>
      <guid>https://dev.to/mainaa/day-1-3152</guid>
      <description>&lt;h2&gt;
  
  
  introduction
&lt;/h2&gt;

&lt;h2&gt;
  
  
  data engineering
&lt;/h2&gt;

&lt;h2&gt;
  
  
  da
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;how it started&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;it is wat is young man&lt;br&gt;
&lt;code&gt;if game=on&lt;br&gt;
yes&lt;br&gt;
elseif&lt;br&gt;
no&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fkok4rx49h94h2fy253ql.jpeg" 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%2Fkok4rx49h94h2fy253ql.jpeg" alt="handshake ai payment dashboard" width="800" height="500"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;handshake is a big scam&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
