<?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: lilian awuor</title>
    <description>The latest articles on DEV Community by lilian awuor (@lilian_awuor).</description>
    <link>https://dev.to/lilian_awuor</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%2F3509566%2Ff5997cba-e252-401e-b7a5-cdedbe6531cc.png</url>
      <title>DEV Community: lilian awuor</title>
      <link>https://dev.to/lilian_awuor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lilian_awuor"/>
    <language>en</language>
    <item>
      <title>Snowflake vs. Star schema in Power Bi</title>
      <dc:creator>lilian awuor</dc:creator>
      <pubDate>Tue, 18 Nov 2025 12:01:59 +0000</pubDate>
      <link>https://dev.to/lilian_awuor/snowflake-vs-star-schema-in-power-bi-55i8</link>
      <guid>https://dev.to/lilian_awuor/snowflake-vs-star-schema-in-power-bi-55i8</guid>
      <description>&lt;p&gt;Power BI, a powerful tool from Microsoft, empowers users to gather, analyze, and visually present data from a wide range of sources. A key component that enhances its effectiveness is the concept of schemas. Schemas help organize and structure data models by defining the relationships between tables. This clear structure not only simplifies data analysis and reporting but also ensures that insights are easily accessible and actionable.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Schema?
&lt;/h1&gt;

&lt;p&gt;Schema is the logical organization and structure of data within a Power BI model. It outlines how your tables are linked, how data flows between them, and ultimately, how smoothly your reports run. A well-designed schema does more than just connect tables—it boosts performance, ensures data accuracy, and creates a clean, intuitive structure that can grow with your needs. The query performance and data efficiency depends on the type of schema being used. There are two main types of schemas in Power BI: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Star Schema &lt;/li&gt;
&lt;li&gt;Snowflake Schema ️ &lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The Star Schema is widely regarded as a best practice in Power BI, particularly when optimizing for performance. Here's why:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Simple and Intuitive&lt;/strong&gt;: The structure looks like a star, with a central fact table (e.g., sales data) surrounded by dimension tables (e.g., customer, product).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Use&lt;/strong&gt;: It’s straightforward, making it ideal for quick reports without complex relationships.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance-Optimized&lt;/strong&gt;: With a one-to-many connection between fact and dimension tables, queries run faster and the model is easier to navigate.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One central table (e.g., Sales) is connected to several smaller Dimension Tables (e.g., Product, Customer, Date) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure:&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%2Fbbw395gy4swofidkukrr.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%2Fbbw395gy4swofidkukrr.png" alt="Starschema" width="493" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact Table – Sales:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SaleID | ProductID | CustomerID | DateID | Quantity | Revenue &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Dimension Tables:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product: ProductID, ProductName, Category, Brand &lt;/li&gt;
&lt;li&gt;Customer: CustomerID, CustomerName, Region &lt;/li&gt;
&lt;li&gt;Date: DateID, Date, Month, Year &lt;/li&gt;
&lt;li&gt;Salesman: SalesmanID, SalesmanName&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How it Works in Power BI&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each sale links to one product, one customer, and one date. &lt;/li&gt;
&lt;li&gt;By selecting a product in a report, data related to that product are filtered. &lt;/li&gt;
&lt;li&gt;This setup is fast, easy to manage, and works well for most reports. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Star Schema&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple to Design &lt;/li&gt;
&lt;li&gt;Fast Performance &lt;/li&gt;
&lt;li&gt;Perfect for Power BI &lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The Snowflake Schema is a more normalized version of the Star Schema, offering a detailed, hierarchical structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hierarchical Structure:&lt;/strong&gt; Dimension tables are split into sub-dimensions, creating multiple levels of relationships. For example, instead of a single "Date" table, you may have separate tables for Month and Year.
-** Reduced Data Redundancy:** By normalizing the data, the Snowflake Schema minimizes duplication, making it easier to manage large datasets efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex Relationships:&lt;/strong&gt; The schema’s structure supports complex relationships, allowing more detailed data breakdowns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance Trade-Offs:&lt;/strong&gt; The Snowflake Schema requires more joins between tables, which can impact query performance as the model scales.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
The Product table is further divided into Category and Brand table. This means more tables and more connections. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure&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%2Fyav0b1ebzl6wri1rkf9b.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%2Fyav0b1ebzl6wri1rkf9b.png" alt="Snowflake Schema" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact Table – Sales&lt;/strong&gt; &lt;br&gt;
SaleID, ProductID, CustomerID, DateID, Quantity, Revenue &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dimension Tables and Sub-Tables:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product → connects to Category and Brand &lt;/li&gt;
&lt;li&gt;Customer → connects to Region &lt;/li&gt;
&lt;li&gt;Date → connects to Month and Year &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product Table: ProductID | ProductName | CategoryID | BrandID &lt;/li&gt;
&lt;li&gt;Category Table: CategoryID | CategoryName &lt;/li&gt;
&lt;li&gt;Brand Table: BrandID | BrandName&lt;/li&gt;
&lt;li&gt;Region Table: RegionID | RegionName&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setup reduces repetition, but adds complexity. &lt;/p&gt;

&lt;h3&gt;
  
  
  Chosing the right Schema
&lt;/h3&gt;

&lt;p&gt;When deciding between the Star and Snowflake Schemas for your model, the following factors should be considered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Volume: For large datasets requiring fast performance, the Star Schema is preferred due to it's simplified structure and fewer joins.&lt;/li&gt;
&lt;li&gt;Data Complexity: If your data is hierarchical and demands detailed relationships, the Snowflake Schema offers more depth and structure.&lt;/li&gt;
&lt;li&gt;User Needs: The Star Schema is ideal for quick, user-friendly report creation, while the Snowflake Schema is better suited for users who need to perform more granular analysis with complex relationships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj5e7lxscl2jfqwnrzeu.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%2Foj5e7lxscl2jfqwnrzeu.png" alt="Difference between Star and Snowflake schema" width="501" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>schema</category>
      <category>powerbi</category>
      <category>star</category>
      <category>snowflake</category>
    </item>
    <item>
      <title>Power BI and DAX- Understanding data</title>
      <dc:creator>lilian awuor</dc:creator>
      <pubDate>Mon, 06 Oct 2025 19:17:46 +0000</pubDate>
      <link>https://dev.to/lilian_awuor/power-bi-and-dax-understanding-data-2pc</link>
      <guid>https://dev.to/lilian_awuor/power-bi-and-dax-understanding-data-2pc</guid>
      <description>&lt;h2&gt;
  
  
  What is Power BI?
&lt;/h2&gt;

&lt;p&gt;Power BI is a data visualization and analysis tool that helps users better understand information—whether it’s numbers, tables, or trends. Instead of relying only on raw tables for analysis, Power BI transforms data into interactive charts, maps, and reports. It also allows users to build dynamic dashboards for real-time, ad-hoc insights into performance and trends.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is this useful?
&lt;/h3&gt;

&lt;p&gt;Imagine you're a farmer in Kenya growing corn, beans, and coffee. You collect all kinds of data: monthly harvest amounts, market prices, and weather patterns. Power BI helps you turn that data into useful insights, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When does corn grow best?&lt;/li&gt;
&lt;li&gt;In which month is coffee the most expensive?&lt;/li&gt;
&lt;li&gt;Which crop gives the highest profit?&lt;/li&gt;
&lt;li&gt;Which regions produces the most coffee in a year?&lt;/li&gt;
&lt;li&gt;How was the corn production in the year 2022 compared to 2025?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is DAX?
&lt;/h3&gt;

&lt;p&gt;Data Analysis Expressions (DAX) is a formula language designed to analyse data in Power BI. It allows you to calculate, filter, and compare data, enabling a deeper analysis compared to programmes like Excel.&lt;br&gt;
DAX enhances Power BI's ability to analyze, visualize and report data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of DAX Functions
&lt;/h3&gt;

&lt;h5&gt;
  
  
  Mathematical Functions
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;CALCULATE(): Applies a calculation with specific filters.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
TotalRevenue_Nairobi = CALCULATE(SUM(Kenya_Crops_Dataset[Revenue (KES)]), Kenya_Crops_Dataset[County] = "Nairobi")&lt;/p&gt;

&lt;h5&gt;
  
  
  Text Functions
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;EXACT(): Compare two Strings and returns “True” only if 100% identical.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: &lt;br&gt;
ExactCropMatch = EXACT(Kenya_Crops_Dataset[Crop Type], "Beans")&lt;/p&gt;

&lt;h5&gt;
  
  
  Date and Time
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;TOTALYTD(SUM(Sales), Date) – Calculates sales from the beginning of the year up to today.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: &lt;br&gt;
Total Revenue(Planting) = TOTALYTD(SUM(Kenya_Crops_Dataset[Revenue (KES)]), Kenya_Crops_Dataset[Planting Date])&lt;/p&gt;

&lt;h5&gt;
  
  
  Logical Functions
&lt;/h5&gt;

&lt;p&gt;-&lt;em&gt;SWITCH(): evaluate an expression against a list of values and return a result that corresponds to the first matching value.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Example: &lt;br&gt;
SWITCH(Product, "Corn", "Group A", "Coffee", "Group B", "Other").&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is this important?
&lt;/h3&gt;

&lt;p&gt;With Power BI and DAX, companies and farmers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;better plan when to sell,&lt;/li&gt;
&lt;li&gt;Identify which product generates the most profit,&lt;/li&gt;
&lt;li&gt;respond quickly to problems like bad weather or falling prices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Power BI and DAX very valuable because they help turn a lot of numbers into smart decisions. Farmers in Kenya (or companies here) can save money, plan better harvests, and spot risks early.&lt;br&gt;
It’s like a “compass” – it helps you find the ideal path without getting lost.&lt;/p&gt;

</description>
      <category>dashboard</category>
      <category>powerbi</category>
      <category>dax</category>
    </item>
  </channel>
</rss>
