<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oluwaseun Adeniran on Medium]]></title>
        <description><![CDATA[Stories by Oluwaseun Adeniran on Medium]]></description>
        <link>https://medium.com/@adeniranmichaelelvis?source=rss-c43fbc64443b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rwSc1Mw386YPFOCKm_tomA.png</url>
            <title>Stories by Oluwaseun Adeniran on Medium</title>
            <link>https://medium.com/@adeniranmichaelelvis?source=rss-c43fbc64443b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:50:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adeniranmichaelelvis/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How a Power BI Sales Dashboard Actually Works]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/how-a-power-bi-sales-dashboard-actually-works-49e2b4e66ac9?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/49e2b4e66ac9</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 11:19:12 GMT</pubDate>
            <atom:updated>2026-09-07T11:19:12.387Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0XGzPXkkN76Y9Y5N6RQww.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jakubzerdzicki?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jakub Żerdzicki</a> on <a href="https://unsplash.com/photos/a-calculator-sitting-on-top-of-a-table-next-to-a-laptop-LgE3whpa5VA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>A Power BI dashboard can make a business look simple.</p><p>A card says £2.4 million in revenue. Another says 31,200 orders. A line chart shows sales increasing month after month. A slicer lets someone select a region, and every number on the page changes.</p><p>The finished dashboard might look straightforward.</p><p>What isn’t visible is everything underneath those numbers.</p><p>Before Power BI can calculate a KPI, it needs to know what each row of data represents, how tables relate to one another, which dates should be used for filtering, and what the business actually means by terms such as “revenue”, “orders”, and “customers”.</p><p>Then DAX takes those definitions and turns them into calculations that respond to the user’s selections.</p><p>That means building a reliable dashboard isn’t simply a matter of dragging fields onto a canvas and writing a few measures. The model underneath the report determines how those measures behave.</p><p>Let’s take a sales KPI dashboard apart from the bottom up.</p><h3>Start With the Data, Not the Dashboard</h3><p>Imagine the underlying sales data looks something like this:</p><pre>OrderID | ProductID | CustomerID | RegionID | OrderDate  | Quantity | UnitPrice | DiscountAmount<br>10001   | P104      | C021       | R01      | 2025-01-04 | 2        | 450       | 50<br>10001   | P211      | C021       | R01      | 2025-01-04 | 1        | 120       | 0<br>10002   | P104      | C084       | R03      | 2025-01-05 | 1        | 450       | 25</pre><p>There is an important detail hiding in this table.</p><p>The first two rows have the same OrderID.</p><p>That’s because the table is stored at the <strong>sales line-item level</strong>. One order can contain several products, so one order can produce several rows.</p><p>That distinction becomes critical later.</p><p>If we count rows, we’re counting line items.</p><p>If we want to count orders, we need to count unique OrderID values.</p><p>If we want average order value, we need to calculate revenue at the order level rather than simply averaging the values in individual rows.</p><p>This is the first principle behind the entire dashboard:</p><p><strong>Before deciding how to calculate a metric, understand the grain of the data.</strong></p><h3>The Star Schema Behind the Dashboard</h3><p>Rather than putting everything into one enormous table, the model separates sales transactions from the descriptive information used to analyse them.</p><p>The central table is FactSales.</p><p>Around it sit dimension tables:</p><pre>DimDate<br>                    |<br>                    |<br>DimCustomer ---- FactSales ---- DimProduct<br>                    |<br>                    |<br>                DimRegion</pre><p>This is a <strong>star schema</strong>.</p><p>The fact table contains the events we want to analyse. In this case, those events are sales line items.</p><p>The dimension tables provide the context we use to slice and analyse those events.</p><p>FactSales contains things such as:</p><pre>OrderID<br>CustomerID<br>ProductID<br>RegionID<br>OrderDate<br>Quantity<br>UnitPrice<br>DiscountAmount</pre><p>DimProduct might contain:</p><pre>ProductID<br>ProductName<br>Category<br>Subcategory</pre><p>DimCustomer might contain:</p><pre>CustomerID<br>CustomerName<br>CustomerSegment</pre><p>DimRegion might contain:</p><pre>RegionID<br>RegionName</pre><p>And DimDate contains the calendar information used to analyse sales over time.</p><p>The important idea is that the fact table stores the <strong>events</strong>, while the dimensions provide the <strong>ways of describing and filtering those events</strong>.</p><p>That separation is what makes the model easier to reason about.</p><h3>Why the Dimensions Filter the Fact Table</h3><p>The relationships between these tables are just as important as the tables themselves.</p><p>A typical relationship looks like this:</p><pre>DimCustomer (1) -------- (*) FactSales<br>DimProduct  (1) -------- (*) FactSales<br>DimRegion   (1) -------- (*) FactSales<br>DimDate     (1) -------- (*) FactSales</pre><p>The 1 means a value should appear once on the dimension side.</p><p>The * means many matching rows can exist in the fact table.</p><p>For example, a customer might appear once in DimCustomer but have hundreds of sales rows in FactSales.</p><p>When a user selects a customer in a slicer, Power BI can follow the relationship from DimCustomer into FactSales and restrict the sales rows to that customer.</p><p>The measures then calculate over the filtered rows.</p><p>This is why relationships are not just connections between tables.</p><p><strong>Relationships determine how filters move through the model.</strong></p><p>That becomes extremely important when writing DAX.</p><p>For this model, filtering is deliberately kept flowing from dimensions into the fact table.</p><pre>Dimension → Fact</pre><p>Keeping the direction predictable makes the model easier to understand and reduces the possibility of unexpected filter paths between tables.</p><h3>Why a Proper Date Table Matters</h3><p>Time-based analysis introduces another important modelling concept: the date dimension.</p><p>A date table shouldn’t simply be a list of dates that happen to appear in the sales table.</p><p>It should represent the calendar independently of whether a sale happened on a particular date.</p><p>For example:</p><pre>DimDate =<br>CALENDAR(<br>    DATE(2023, 1, 1),<br>    DATE(2026, 12, 31)<br>)</pre><p>The resulting table can then contain additional calendar attributes such as:</p><pre>Date<br>Year<br>Month<br>Month Number<br>Quarter<br>Year Month</pre><p>Why does this matter?</p><p>Suppose a business had no sales on 14 February.</p><p>That date still exists in the calendar.</p><p>The absence of a transaction shouldn’t mean the date disappears from the time dimension.</p><p>This becomes particularly important when comparing periods and building time-intelligence calculations.</p><p>The date table provides the continuous calendar that those calculations operate against.</p><h3>Now We Can Build the Measures</h3><p>Once the model is structured correctly, the DAX becomes much easier to understand.</p><p>The first measure is total revenue.</p><pre>Total Revenue =<br>SUMX(<br>    FactSales,<br>    FactSales[Quantity] * FactSales[UnitPrice]<br>        - FactSales[DiscountAmount]<br>)</pre><p>At first glance, this might look like a straightforward aggregation.</p><p>It isn’t quite.</p><p>There is no single stored column containing the final revenue for every row.</p><p>Instead, each line needs to be calculated:</p><pre>Quantity × Unit Price − Discount</pre><p>SUMX evaluates that expression row by row and then adds the results together.</p><p>For example:</p><pre>2 × £450 − £50 = £850<br>1 × £120 − £0  = £120<br>1 × £450 − £25 = £425</pre><p>Total revenue would therefore be:</p><pre>£850 + £120 + £425 = £1,395</pre><p>The important concept here isn’t simply “use SUMX when you need multiplication.&quot;</p><p>It is that DAX can <strong>iterate through a table, evaluate an expression for each row, and then aggregate the results</strong>.</p><p>That distinction becomes useful whenever the value we need doesn’t already exist as a column.</p><h3>Counting Orders Correctly</h3><p>Now consider orders.</p><p>A tempting calculation would be:</p><pre>Total Orders =<br>COUNTROWS(FactSales)</pre><p>But remember the grain of the table.</p><p>FactSales contains one row per line item.</p><p>If one customer places an order containing five products, that order can produce five rows.</p><p>COUNTROWS would therefore count five rows, not one order.</p><p>Instead:</p><pre>Total Orders =<br>DISTINCTCOUNT(FactSales[OrderID])</pre><p>Now Power BI counts each order ID once.</p><p>This is a simple example of why understanding the data model comes before writing the measure.</p><p>The DAX function isn’t the difficult part.</p><p>Knowing <strong>what should be counted</strong> is.</p><h3>Average Order Value Is Where Grain Becomes a Business Problem</h3><p>With revenue and orders defined correctly, Average Order Value becomes surprisingly simple:</p><pre>Average Order Value =<br>DIVIDE(<br>    [Total Revenue],<br>    [Total Orders]<br>)</pre><p>Notice what isn’t here.</p><p>There is no AVERAGE.</p><p>There is no AVERAGEX(FactSales, ...).</p><p>Why?</p><p>Because averaging the rows in FactSales would give us an average line-item value.</p><p>That is not necessarily the same thing as average order value.</p><p>The correct business definition is:</p><pre>Total Revenue ÷ Total Orders</pre><p>Suppose the dashboard contains:</p><pre>Revenue: £100,000<br>Orders: 2,000</pre><p>Then:</p><pre>£100,000 ÷ 2,000 = £50</pre><p>The average order value is £50.</p><p>This illustrates a broader lesson about DAX:</p><p><strong>A technically valid calculation can still answer the wrong business question.</strong></p><h3>Customer Count Is More Specific Than It Looks</h3><p>Customer count appears straightforward too:</p><pre>Total Customers =<br>DISTINCTCOUNT(FactSales[CustomerID])</pre><p>But what does this actually mean?</p><p>It means the number of distinct customers represented in the currently filtered sales data.</p><p>If the dashboard is filtered to March, the measure answers:</p><blockquote><em>How many customers purchased something in March?</em></blockquote><p>It does not answer:</p><blockquote><em>How many customers exist in our customer database?</em></blockquote><p>Those are two different metrics.</p><p>If the business wants the total number of registered customers, the calculation would need to operate against DimCustomer rather than the filtered sales transactions.</p><p>This is why naming and defining measures matters.</p><p>“Total Customers” sounds precise, but without understanding the underlying calculation and filter context, a stakeholder could easily interpret it differently.</p><h3>The Same Measure Can Change When the User Changes the Context</h3><p>This is where Power BI starts behaving differently from a traditional spreadsheet.</p><p>A measure doesn’t simply calculate one fixed number and store it.</p><p>It evaluates according to the current <strong>filter context</strong>.</p><p>Suppose we have:</p><pre>Total Revenue =<br>SUMX(<br>    FactSales,<br>    FactSales[Quantity] * FactSales[UnitPrice]<br>        - FactSales[DiscountAmount]<br>)</pre><p>With no filters, the measure calculates revenue across the entire dataset.</p><p>Select the West region, and the same measure recalculates over the sales rows associated with West.</p><p>Select Technology as the product category, and it recalculates again.</p><p>Select March 2026 and West and Technology, and the calculation operates within all of those filters together.</p><p>The DAX measure hasn’t changed.</p><p><strong>The context in which the measure is evaluated has changed.</strong></p><p>That is one of the most important concepts to understand when working with Power BI.</p><h3>Building Month-over-Month Analysis</h3><p>Now we can use the date dimension to compare the current period with the previous month.</p><p>Start with the current value:</p><pre>Total Revenue =<br>SUMX(<br>    FactSales,<br>    FactSales[Quantity] * FactSales[UnitPrice]<br>        - FactSales[DiscountAmount]<br>)</pre><p>Then create the previous-month calculation:</p><pre>Revenue Previous Month =<br>CALCULATE(<br>    [Total Revenue],<br>    DATEADD(<br>        DimDate[Date],<br>        -1,<br>        MONTH<br>    )<br>)</pre><p>DATEADD shifts the dates in the current context back by one month.</p><p>If the current context represents March 2026, the calculation evaluates the revenue measure against February 2026.</p><p>The final comparison becomes:</p><pre>Revenue MoM % =<br>VAR CurrentRevenue =<br>    [Total Revenue]</pre><pre>VAR PriorRevenue =<br>    CALCULATE(<br>        [Total Revenue],<br>        DATEADD(<br>            DimDate[Date],<br>            -1,<br>            MONTH<br>        )<br>    )</pre><pre>RETURN<br>    DIVIDE(<br>        CurrentRevenue - PriorRevenue,<br>        PriorRevenue<br>    )</pre><p>The formula calculates:</p><pre>(Current Revenue − Previous Revenue) ÷ Previous Revenue</pre><p>If March revenue is £120,000 and February revenue is £100,000:</p><pre>(£120,000 − £100,000) ÷ £100,000<br>= 20%</pre><p>The important part is that we haven’t hardcoded February or March into the measure.</p><p>The calculation responds to the current date context.</p><p>That means the same measure can be used in a card, a table, or a chart and evaluated against the relevant period.</p><h3>Why the Same Pattern Works for Other KPIs</h3><p>Once the model and pattern are established, the same logic can be applied to other measures.</p><p>For orders:</p><pre>Orders MoM % =<br>VAR CurrentOrders =<br>    [Total Orders]</pre><pre>VAR PriorOrders =<br>    CALCULATE(<br>        [Total Orders],<br>        DATEADD(<br>            DimDate[Date],<br>            -1,<br>            MONTH<br>        )<br>    )</pre><pre>RETURN<br>    DIVIDE(<br>        CurrentOrders - PriorOrders,<br>        PriorOrders<br>    )</pre><p>The calculation structure stays the same.</p><p>Only the base measure changes.</p><p>This makes the dashboard easier to maintain because the KPIs follow a consistent definition of month-over-month change.</p><h3>Reading the KPIs Together</h3><p>The real value of a KPI dashboard isn’t any individual number.</p><p>It’s the relationship between the numbers.</p><p>Imagine the dashboard shows:</p><pre>Revenue          ↑<br>Customer Count   ↑↑<br>Average Order    ↓<br>Units Sold       →</pre><p>That tells a more interesting story than revenue increasing by itself.</p><p>Revenue is growing, but average order value is falling while the customer count is increasing.</p><p>One possible interpretation is that growth is being driven by <strong>more customers making smaller purchases</strong> rather than existing customers spending more.</p><p>The dashboard doesn’t automatically prove why that happened.</p><p>It gives us a pattern worth investigating.</p><p>That’s an important distinction.</p><p>A good dashboard should help you ask better questions, not pretend that every correlation is an explanation.</p><h3>What Happens When the Model Is Wrong?</h3><p>The dangerous thing about Power BI errors is that they don’t always look like errors.</p><p>A poorly modelled dashboard can still display:</p><pre>£2.4M<br>31,200<br>8,420<br>18.4%</pre><p>Every card can render successfully.</p><p>There may be no DAX error.</p><p>The scheduled refresh may complete successfully.</p><p>And the numbers can still be wrong.</p><p>For example, if the fact table is at line-item level but someone uses COUNTROWS to represent orders, the dashboard can report an inflated order count.</p><p>If a relationship doesn’t filter the fact table as expected, a slicer may appear to work while leaving a particular visual unchanged.</p><p>If one KPI uses a different date relationship from the others, two apparently comparable metrics may actually be comparing different periods.</p><p>If a measure averages rows when the business wants average orders, the calculation can be mathematically correct while the KPI itself is conceptually wrong.</p><p>This is why the model matters so much.</p><p>DAX doesn’t exist in isolation.</p><p><strong>The meaning of a measure depends on the data, the relationships, the filter context, and the business definition behind it.</strong></p><h3>The Full Chain</h3><p>A useful way to think about a Power BI report is as a chain:</p><pre>Source Data<br>    ↓<br>Data Grain<br>    ↓<br>Data Model<br>    ↓<br>Relationships<br>    ↓<br>Filter Context<br>    ↓<br>DAX Measures<br>    ↓<br>Visuals<br>    ↓<br>Business Decisions</pre><p>A problem near the beginning can propagate all the way to the final dashboard.</p><p>That’s why building a Power BI report properly isn’t just about writing clever DAX.</p><p>The DAX sits in the middle of a much larger system.</p><p>You need to understand what the data represents before you aggregate it.</p><p>You need a model that allows filters to travel predictably.</p><p>You need measures that reflect the actual business definitions.</p><p>And you need to understand the context in which those measures are evaluated.</p><p>Once those foundations are right, the visual layer becomes the easy part.</p><p>The dashboard is simply the surface.</p><p><strong>The real Power BI solution is everything underneath it.</strong></p><p>The complete Sales KPI Dashboard, including the underlying data, model and measures, is available on <a href="https://github.com/Seunelvis1">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49e2b4e66ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Experienced Power BI Developers Still Get DAX Wrong]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/why-experienced-power-bi-developers-still-get-dax-wrong-5a1d849c475d?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a1d849c475d</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 09:52:14 GMT</pubDate>
            <atom:updated>2026-09-05T09:52:14.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o25FsSVzXqZFUxQpTSJDOQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@charlesdeluvio?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">charlesdeluvio</a> on <a href="https://unsplash.com/photos/person-facing-computer-desktop-pjAH2Ax4uWk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Beginners make DAX mistakes that are obvious. A missing CALCULATE, a measure referencing the wrong column, a total that clearly doesn’t add up. Those get caught fast, because they look wrong.</p><p>Experienced developers make a different kind of mistake. The measure runs. The number looks believable. It responds to filters the way you’d expect. Nothing about it looks broken, and that is exactly the problem, because the number is still wrong, quietly, in a way that only shows up once someone downstream makes a decision based on it.</p><p>The uncomfortable question underneath all of this is not whether your DAX is valid. It almost always is. The real question is whether your mental model of what Power BI is actually evaluating matches what Power BI is actually doing. Those two things drift apart more often than experienced developers like to admit.</p><p>Let’s pull that apart, one assumption at a time.</p><p>You know CALCULATE. But do you know what it actually changes?</p><pre>Sales LY =<br>CALCULATE(<br>    [Total Sales],<br>    SAMEPERIODLASTYEAR(&#39;Date&#39;[Date])<br>)</pre><p>Everyone who has spent time in Power BI can write this. Fewer people can explain precisely what happens to the filter context already sitting around it the moment CALCULATE runs.</p><p>CALCULATE does not simply add a new filter alongside whatever already exists. It takes the current filter context, applies the filter arguments you have given it, and produces a new context that replaces filters on the same columns while leaving everything else untouched. SAMEPERIODLASTYEAR does not stack on top of your existing date filter. It replaces it, using the existing filter as the reference point for what “last year” even means.</p><p>This distinction barely matters in a simple report. It matters enormously the moment that measure sits inside a visual with a slicer on Region, another on Product Category, and a page level filter on Customer Segment. Understanding CALCULATE syntax gets you a working formula. Understanding what it replaces versus what it preserves is what tells you whether the number in front of you actually means what you think it means.</p><p>The measure changes depending on what surrounds it</p><p>Here is something that sounds obvious stated plainly and still trips people up constantly in practice. A measure is not a value sitting somewhere waiting to be displayed. It is a formula that gets recalculated every single time the surrounding context changes.</p><p>Put Total Sales on a card by itself, and it evaluates against the broadest context available, usually the whole table. Put that exact same measure into a matrix broken out by Region, and now it evaluates once per region, each time inside a narrower context defined by that row. Add Product Category as a second dimension, and it evaluates again, inside the intersection of both.</p><p>None of this is new information to anyone who has used Power BI for more than a week. What experienced developers underestimate is how often a measure that looks correct at one grain quietly stops representing what they intended the moment it moves to a different one. A measure is only ever answering the question implied by whatever context surrounds it, and that question changes every time you drag a new field into the visual.</p><p>Row context is not filter context</p><p>This is the one that separates people who can write DAX from people who actually understand what DAX is doing underneath.</p><pre>Product Revenue =<br>SUMX(<br>    Products,<br>    Products[Price] * Products[Quantity]<br>)</pre><p>SUMX iterates over the Products table, and on each row, it knows exactly which row it is standing on. That is row context. It has no relationship, on its own, to the filters currently applied across your report.</p><p>The interesting part is what happens the moment that expression references a measure instead of a column.</p><pre>Product Revenue =<br>SUMX(<br>    Products,<br>    [Total Sales]<br>)</pre><p>Total Sales is a measure, and measures expect filter context, not row context. The instant DAX evaluates a measure inside an iterator, it converts the current row into an equivalent filter context automatically, as if every column on that row had been passed into CALCULATE. This is context transition, and it happens silently, on every single row, every time.</p><p>Most developers can recite that context transition exists. Fewer stop to check whether the relationship carrying that transitioned filter is actually active, correctly directed, and connects to something meaningful. When it doesn’t, the measure still runs. It just quietly transitions into a filter context with nothing behind it, and returns a number that looks plausible while representing almost nothing.</p><p>SUM and SUMX can agree until the exact moment they don’t</p><pre>Total Sales =<br>SUM(Sales[SalesAmount])</pre><p>versus</p><pre>Total Sales =<br>SUMX(<br>    Sales,<br>    Sales[Quantity] * Sales[UnitPrice]<br>)</pre><p>On a clean table, these two return identical numbers, and that agreement is precisely what lets people assume they are interchangeable. They are not. SUM reads a stored value. SUMX recalculates a value per row, using whatever logic you give it.</p><p>The gap opens the moment the stored SalesAmount column and the live Quantity times UnitPrice calculation stop meaning exactly the same thing. Introduce a discount applied after the fact, a return that adjusts quantity without adjusting the stored amount, or a tax calculation added at different points in each, and the two measures diverge, both still technically correct, both now answering different questions.</p><p>The actual decision buried here is not a technical one. It is which calculation represents the business definition of revenue that your organisation has actually agreed on, and whether that definition is even documented anywhere outside the measure itself.</p><p>Your DAX might be fine. Your model might not be.</p><pre>Customer<br>   |<br>Sales<br>   |<br>Product</pre><p>This same shape can behave in completely different ways depending on relationship direction, cardinality, and which side is filtering which. A measure referencing Product fields can respond to a Customer level filter perfectly well, or not at all, depending entirely on how that middle relationship is configured, and none of that is visible from the measure itself.</p><p>This is where experienced developers most often waste time. They rewrite a measure five times, testing variations of logic that were never the actual problem, because the fault sits one layer beneath the formula bar, in a relationship they built early on and stopped thinking about.</p><p>Granularity is the DAX problem nobody notices</p><p>Say a Sales table contains multiple rows per order, one row per line item.</p><pre>Average Sales =<br>AVERAGE(Sales[SalesAmount])</pre><p>This measure is completely valid. It is also very likely not measuring what most people assume it is. Because the table’s grain is one row per line item, this calculates the average line item value, not the average order value. If a single order contains four line items, that order contributes four separate values to the average instead of one.</p><p>The correct version requires first collapsing to the actual grain you care about.</p><pre>Average Order Value =<br>AVERAGEX(<br>    VALUES(Sales[OrderID]),<br>    CALCULATE(SUM(Sales[SalesAmount]))<br>)</pre><p>This is the sort of mistake that survives in production for months, because both versions return a plausible looking number, and only one of them answers the question the business actually asked.</p><p>ALL, REMOVEFILTERS and ALLEXCEPT are not interchangeable</p><p>Say the requirement is percentage of total sales, something that sounds like it should have one obvious answer.</p><pre>Pct of Total =<br>DIVIDE(<br>    [Total Sales],<br>    CALCULATE([Total Sales], ALL(Sales))<br>)</pre><p>versus</p><pre>Pct of Total by Region =<br>DIVIDE(<br>    [Total Sales],<br>    CALCULATE([Total Sales], ALLEXCEPT(Sales, Sales[Region]))<br>)</pre><p>ALL clears every filter from the table entirely, giving you percentage of the grand total regardless of anything else selected. ALLEXCEPT clears everything except the columns you specify, which means the denominator still respects a Region filter while ignoring everything else. REMOVEFILTERS behaves like ALL but signals intent more clearly and works across relationships in ways ALL sometimes doesn’t, depending on your model version.</p><p>Choosing between these is not a syntax decision. It is a decision about which percentage you actually want to report, and getting it wrong produces a number that reconciles, filters correctly, and still answers the wrong question entirely.</p><p>The debugging technique experienced developers actually need</p><p>Faced with a forty line measure that returns the wrong number, the instinct is usually to stare at the whole thing at once. That rarely works. Variables work better, because they let you name and inspect each assumption individually.</p><pre>Revenue =<br>VAR GrossRevenue =<br>    [Units Sold] * [Unit Price]<br>VAR Discounts =<br>    [Discount Amount]<br>VAR NetRevenue =<br>    GrossRevenue - Discounts<br>RETURN<br>    NetRevenue</pre><p>The value of this is not tidiness. It is that you can temporarily change the RETURN line to output GrossRevenue alone, then Discounts alone, and isolate exactly which assumption is producing the wrong number before touching the rest of the formula. Variables turn a single opaque calculation into a series of testable claims.</p><p>The number can be correct and still be wrong</p><p>A measure can execute without error, respond to every filter correctly, reconcile against source data, and run with no performance issue whatsoever, and still answer the wrong business question entirely.</p><p>That gap has a name worth keeping in mind. Calculation correctness is whether the formula does what it says. Semantic correctness is whether what it says is actually the thing the business meant. DAX only ever guarantees the first one. The second one is on you, and it is the harder problem by a wide margin.</p><p>The experienced developer’s trap</p><p>The advantage an experienced developer has was never knowing more functions than everyone else. It is knowing when to stop typing and ask what Power BI is actually evaluating right now, before assuming the formula is the thing at fault.</p><p>A short list worth running through before rewriting anything.</p><ul><li>What is the current filter context?</li><li>What is the current row context, and is it transitioning into something?</li><li>Which relationships are active, and which direction are they filtering in?</li><li>What is the actual grain of the data being calculated over?</li><li>What is being added or removed by CALCULATE at this exact point?</li><li>What does the business metric actually mean, and does this formula still represent that?</li><li>What does the business metric actually mean, and does this formula still represent that?</li></ul><p>Most DAX that looks broken traces back to a mismatch somewhere on that list, not to a syntax error. The syntax was almost always fine. The assumption underneath it wasn’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a1d849c475d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Context Transition Is the Real Reason CALCULATE Confuses Everyone]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/context-transition-is-the-real-reason-calculate-confuses-everyone-cb25e2c6b2a3?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb25e2c6b2a3</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 16:04:12 GMT</pubDate>
            <atom:updated>2026-09-02T16:04:12.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Nq0wbP-Xv3zzBqDT30WPg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jakubzerdzicki?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jakub Żerdzicki</a> on <a href="https://unsplash.com/photos/smartphone-calculator-on-desk-with-financial-charts-behind-ip7GFn5JqX8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I want to start with a measure that looks completely reasonable and does something most people don’t expect.</p><pre>Customer Count =<br>COUNTROWS(Customers)</pre><pre>Customers With High Value Orders =<br>CALCULATE(<br>    COUNTROWS(Customers),<br>    FILTER(Customers, [Total Order Value] &gt; 1000)<br>)</pre><p>Total Order Value is itself a measure. Something like SUM of Orders joined back to Customers. Run this, and it works, correctly counting customers whose orders exceed a thousand pounds. Most people accept that it works and move on.</p><p>Almost nobody can explain why it works, and that gap is where a huge number of DAX bugs come from later.</p><p>Row context and filter context are not the same thing</p><p>Every DAX explanation starts here, so I will keep it quick, because the interesting part is what happens next, not this bit.</p><p>Row context exists when DAX is iterating, moving through a table one row at a time. FILTER, SUMX, and calculated columns all create row context. Inside that context, DAX knows exactly which row it is currently sitting on.</p><p>Filter context is different. It is the set of filters currently applied to your entire model, coming from slicers, visuals, or CALCULATE itself. A measure evaluates against whatever filter context surrounds it, with no concept of “current row” unless something creates one.</p><p>Most tutorials stop there. That is also exactly where the confusion starts, because the FILTER function above is iterating over Customers, which means it has row context. And inside that row context, it is calling a measure, Total Order Value, which expects filter context, not row context.</p><p>Those two things should not be able to talk to each other. And yet they do.</p><p>This is context transition</p><p>When you reference a measure inside a row context, DAX automatically takes the current row and converts it into an equivalent filter context. Every column value on that row becomes a filter, as if you had wrapped the whole thing in CALCULATE yourself.</p><p>So inside FILTER, on the row where CustomerID equals 4821, DAX effectively filters the entire model down to CustomerID 4821, then evaluates Total Order Value inside that filtered world. That is context transition. Row becomes filter, silently, the instant a measure gets referenced inside an iterator.</p><p>This single mechanism is why so much DAX appears to work by magic. It also explains a specific category of bug that confuses experienced analysts, not beginners.</p><p>The bug that only shows up once you understand this</p><p>Here is a calculated column, not a measure, doing something that looks identical to the FILTER example above.</p><pre>High Value Flag =<br>IF([Total Order Value] &gt; 1000, &quot;Yes&quot;, &quot;No&quot;)</pre><p>This is a calculated column on the Customers table. It also references a measure inside row context. Context transition fires exactly the same way, converting each row into its own filtered evaluation.</p><p>The difference that catches people out is when this same pattern gets applied on a table without a clean one-to-many relationship back to Orders, or on a table where the relevant relationship is inactive. Context transition still fires. It just transitions into a filter context that has no rows behind it, because the relationship never carried the filter through.</p><p>The column calculates. It does not error. It just quietly returns the wrong thing for every row, because context transition succeeded technically while failing to reach the data you actually needed it to reach.</p><p>This is the deeper reason “check your relationships first” matters more than it sounds like it should. Context transition depends entirely on relationships being active and correctly directed to actually carry that filter where you need it to go.</p><p>Where this genuinely changes how you write DAX</p><p>Once context transition clicks, a few habits change.</p><p>You stop being surprised when a measure referenced inside SUMX behaves differently to how it behaves on a card by itself. It is not the same measure behaving inconsistently. It is the same measure being evaluated inside a completely different context, row turned filter, every single iteration.</p><p>You start being cautious about performance too. Context transition is not free. Every row that triggers it effectively runs a fresh CALCULATE underneath, which on a large iteration over a fact table can mean millions of individual filter context evaluations rather than one. This is a real, measurable cost, and it is usually the actual explanation behind a SUMX that feels inexplicably slow even though the logic inside it looks simple.</p><p>You also start reading other people’s broken measures differently. Someone posts a slow or wrong measure, and instead of hunting for a typo, the first question becomes: where is context transition firing here, and is it firing against the relationships I think it is?</p><p>A quick way to actually see it happening</p><p>If you want to watch context transition in action rather than just take my word for it, build this pair side by side on a card.</p><pre>Row Context Test =<br>SUMX(<br>    Customers,<br>    [Total Order Value]<br>)</pre><pre>Direct Total =<br>SUM(Orders[OrderValue])</pre><p>If your relationships are healthy, both should return the same total, because SUMX is triggering context transition per customer row, summing each customer’s filtered order value, which mathematically lands back on the same grand total as summing every order directly.</p><p>Break a relationship deliberately, set it to inactive, or point it the wrong direction, and watch Row Context Test diverge from Direct Total. That gap is context transition failing to carry the filter through, made visible.</p><p>The checklist worth keeping</p><p>Whenever a measure referenced inside an iterator, a calculated column, or a FILTER produces something unexpected, ask these in order.</p><p>Is context transition actually firing here, meaning is a measure being called inside row context?</p><p>Is the relationship carrying that transitioned filter actually active and pointed in the direction you need?</p><p>Would the same measure, called directly without row context, return a different answer, and if so, why?</p><p>Is the iteration happening over a table large enough that the per row cost of context transition is the actual performance problem, not the measure’s logic.</p><p>Most of the DAX bugs people bring to me eventually trace back to one of these four, once you know to look.</p><p>If you have ever had a measure behave differently inside SUMX than it did sitting alone on a card, and eventually traced it back to exactly this, I would genuinely like to hear how you found it. That specific debugging moment tends to be where DAX actually starts making sense, rather than just working.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb25e2c6b2a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Am I the Problem? A Data Analyst’s Relentless Interrogation of the Numbers We Present to the World]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/what-if-my-dashboard-is-wrong-e721e07e4bb3?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e721e07e4bb3</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:04:47 GMT</pubDate>
            <atom:updated>2026-09-02T15:56:32.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9wDz3fQxnBOpuaz8TO8Bkw.png" /><figcaption><a href="https://unsplash.com/illustrations/business-data-charts-on-a-clipboard-and-digital-tablet-f4757_4JULg?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Illustration</a> by <a href="https://unsplash.com/@afieqabdillah/illustrations?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Afieq Abdillah</a> on <a href="https://unsplash.com/illustrations?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>The card on the canvas sits there, glowing in bold, crisp typography: £2.4M.</p><p>It looks clean. It looks authoritative. Power BI displays a reassuring green checkmark indicating that the scheduled refresh succeeded without a hitch. There are no syntax errors, no red squiggly lines in my DAX measures, and the layout aligns to the pixel. By every surface metric of our craft, the job is done.</p><p>Yet, before I publish the report or send the link to a single executive, a quiet, necessary anxiety sets in. I stare at that number and ask myself the only question that truly matters:</p><p>Why should anyone believe this?</p><p>Not because the visual looks sleek. Not because the backend refresh passed. Not because the calculation executed cleanly. And most definitely not because I was the one who built it.</p><p>A number can be syntactically perfect, technically error-free, and still answer the completely wrong question.</p><p>That is why I do not build dashboards just to showcase data. I build them, and then I try to tear them apart. I try to prove them wrong before someone else does.</p><h3>Case File: The £2.4M Headline</h3><p>Imagine the canvas in front of us. It presents four key story points:</p><p>Total Sales: £2.40M</p><p>Total Orders: 31,200</p><p>Unique Customers: 8,420</p><p>Total Profit: £286K</p><p>It tells a neat, comforting story. But neatness in data analysis is often a mask for unexamined assumptions.</p><p>To test whether this story holds up under pressure, I strip away every slicer on the page. Then, slowly and deliberately, I add them back one by one: Date, Region, Product, Customer. I watch how the canvas reacts.</p><p>I ask:</p><p>Does it move when it should?</p><p>It sounds embarrassingly simple. Yet this single habit catches more silent, catastrophic model failures than almost anything else.</p><h3>Test 01: Can I Reproduce the Number?</h3><p>If Power BI tells me total sales are £2.4M, I refuse to let Power BI be the sole witness testifying to that fact. I step outside the reporting tool and go directly back to the raw source data.</p><p>I execute a simple SQL sanity check against the database:</p><pre>SELECT<br>    COUNT(*) AS row_count,<br>    COUNT(DISTINCT order_id) AS order_count,<br>    SUM(sales_amount) AS total_sales<br>FROM sales;</pre><p>When the query completes, I stack the results side by side against my model:</p><p>Power BI Reported Sales: £2.40M<br>SQL Source Sales: £2.40M</p><p>Power BI Reported Orders: 31,200<br>SQL Source Distinct Orders: 31,200</p><p>SQL Total Dataset Rows: 48,500</p><p>The matching £2.40M sales figure brings a moment of relief, but the row count demands an immediate pause.</p><p>Why are there 48,500 rows in the table when there are only 31,200 unique orders?</p><p>Perhaps the table stores data at the line-item level, meaning a single order with three items produces three distinct rows. That is completely normal if you know about it.</p><p>But if you start writing DAX or SQL aggregations without recognizing that underlying granularity, you are setting up a ticking time bomb.</p><p>Grain always comes before aggregation.</p><p>That single discipline will save you from a career of delivering very confident, very wrong numbers.</p><h3>Test 02: What Exactly Am I Calculating?</h3><p>Consider what is arguably the simplest DAX measure you can write:</p><pre>Total Sales = SUM(Sales[SalesAmount])</pre><p>It is elegant in its brevity. But simplicity does not guarantee truth.</p><p>What does SalesAmount actually represent in the real world?</p><p>Is it gross revenue before discounts? Is it net revenue after markdowns? Does it include or exclude tax? Does it account for cancelled orders that were never shipped, or pending returns currently sitting in a warehouse?</p><p>DAX cannot answer those questions for you.</p><p>Code only processes the logic you give it. It has no concept of business reality.</p><p>I can write flawless code for an incorrect definition and produce a gorgeous dashboard that actively misleads the business.</p><p>We must strictly separate two distinct questions:</p><p>How do I calculate this?</p><p>That is a technical question for DAX or SQL.</p><p>What should this number actually mean?</p><p>That is a strategic question for the business definition.</p><p>Analysts often rush straight to the technical execution because it feels actionable. But mastering the business definition is where real analysis happens.</p><h3>Test 03: Can the Model Survive a Slicer?</h3><p>Now it is time to make the model uncomfortable.</p><p>I select the West region on my slicer. The overall sales figure drops from £2.40M to £730K. That feels right.</p><p>Next, I filter down to Technology. The number adjusts again as expected.</p><p>Then, I select a specific customer, and one of my key visuals remains completely static.</p><p>That is the exact moment I stop admiring the canvas and start investigating the engine room.</p><p>I jump into the Model View, inspect the relationships, and trace the path:</p><p>Customer → ? → Sales → Visual</p><p>Can the filter context actually travel from the Customer table to the Sales table?</p><p>Is the relationship active?</p><p>Is it a one-to-many or many-to-many relationship?</p><p>Is the cross-filter direction flowing in the way I assumed it was?</p><p>Just because a slicer sits on a page does not mean it is genuinely governing every visual on that page.</p><h3>Test 04: Try to Break the Measure</h3><p>This is where DAX logic gets subtle and treacherous.</p><p>Suppose I create an average sales measure:</p><pre>Average Sales = AVERAGE(Sales[SalesAmount])</pre><p>I place it on a card directly beside my main summary measure:</p><pre>Total Sales = SUM(Sales[SalesAmount])</pre><p>Visually, everything looks completely fine.</p><p>But what does Average Sales actually mean to the executive reading it?</p><p>Does it mean Average Transaction Value?</p><p>Average Order Value?</p><p>Or Average Customer Spend?</p><p>Those three concepts represent entirely different operational metrics.</p><p>If the underlying sales table contains multiple line items per order, then averaging SalesAmount at the row level returns the average line-item value, not the average order value.</p><p>The DAX formula is not broken. It calculated exactly what was requested.</p><p>But the definition is broken.</p><p>That distinction is the boundary between a coder and an analyst.</p><h3>Test 05: Look for Duplication</h3><p>One of my favorite SQL checks is also one of the most unglamorous. Because it feels routine, people skip it.</p><p>If I suspect a table join has silently duplicated records and inflated my metrics, I run a grouping query:</p><pre>SELECT<br>    order_id,<br>    COUNT(*) AS occurrences<br>FROM sales<br>GROUP BY order_id<br>HAVING COUNT(*) &gt; 1;</pre><p>Duplicate order_id records are not inherently an error.</p><p>If a customer bought five distinct products in a single checkout, seeing that order ID five times is exactly what the schema ought to deliver.</p><p>The real question is:</p><p>Do you know the exact grain of the table you are querying?</p><p>If you do not know what a single row represents, you cannot know what your SUM, COUNT, or AVERAGE truly means.</p><h3>Test 06: Compare Two Things That Should Agree</h3><p>This is one of the fastest and most effective ways to uncover hidden flaws in logic.</p><p>Take two visuals on the same page that are supposed to tell the exact same story from different angles.</p><p>On the top left, a KPI card reads:</p><p>Total Sales: £2.40M</p><p>Just below it, a bar chart breaks down Sales by Region:</p><p>West: £730K</p><p>East: £680K</p><p>Central: £500K</p><p>South: £390K</p><p>I open a calculator and manually sum the regional breakdown:</p><p>730K + 680K + 500K + 390K = £2.30M</p><p>Wait.</p><p>The headline card says £2.40M, but the sum of all regions adds up to £2.30M.</p><p>There is a £100K discrepancy hiding in plain sight.</p><p>Where is that missing £100K?</p><p>Is there an unmapped region coded as NULL in the source system?</p><p>Is a cross-filter silently excluding a product category in one visual but not the other?</p><p>Is a relationship behaving differently across tables?</p><p>I do not try to explain the gap away or hope nobody notices.</p><p>I hunt it down until I know precisely why it exists.</p><h3>The Chain of Trust</h3><p>When I review a data solution, I evaluate trust as an unbroken pipeline:</p><p>SOURCE → DATA → MODEL → DAX → VISUAL → DECISION</p><p>A breach anywhere along this chain destroys the integrity of the ultimate decision.</p><p>Look closely at where the Visual sits in that sequence: right near the very end.</p><p>Yet, as developers, that is often where we spend 80% of our energy.</p><p>We tweak colors, adjust font sizes, pad margins, align cards, and add extra slicers.</p><p>Meanwhile, the number resting underneath all that design polish might still be wrong.</p><h3>My Five-Minute Dashboard Interrogation</h3><p>Before I declare any dashboard complete, I put my work through a strict, uncompromising checklist:</p><ol><li>What does one single row in this dataset represent?</li></ol><p>If I cannot answer this instantly, I do not understand the grain, and I cannot trust the aggregation.</p><p>2. Where did this specific KPI originate?</p><p>I trace every core metric directly back to its source schema to verify lineage.</p><p>3. Can I reproduce this calculated number independently?</p><p>I write an external SQL script to validate the output against the raw system of record.</p><p>4. What breaks when I interact with the filter context?</p><p>I stress-test slicers, cross-highlighting, and drill-downs while monitoring the data model.</p><p>5. Does the DAX implementation strictly match the business definition?</p><p>I confirm that technical logic reflects real-world operational rules.</p><p>None of these questions require a stunning canvas or elaborate visual design.</p><p>That is precisely the point.</p><h3>The Uncomfortable Reality of Data Analytics</h3><p>There is a deceptive form of confidence that comes from building a dashboard that looks brilliant.</p><p>It feels good to drag cards into place, build crisp interactions, and hand over a clean interface.</p><p>That is not the confidence that matters.</p><p>The true confidence of a data analyst is the ability to sit in a boardroom when a senior leader points at a visual and says:</p><p>“That number does not look right.”</p><p>And instead of flinching or getting defensive, you can look them in the eye and say:</p><p>“Let’s walk through it together.”</p><p>Then, you walk backward through the chain of trust: from the decision to the visual, through the DAX logic, into the data model, down to the grain, and back to the raw source data.</p><p>If the number is right, you can prove why it is right with absolute clarity.</p><p>If it is wrong, you know exactly how to isolate the error, fix the logic, and elevate the integrity of the system.</p><p>Both outcomes move the business forward.</p><p>What truly concerns me is the analyst who never questions their own metrics simply because everything in Power BI looks green and healthy.</p><p>A successful scheduled refresh only proves that the database did not crash.</p><p>It does not prove that you answered the business question correctly.</p><p>So perhaps the question we should ask less often is:</p><p>“Does my dashboard work?”</p><p>And the question we should ask every single day is:</p><p>“What would I have to discover to prove this dashboard wrong?”</p><p>Asking that question has made me far more cautious with the metrics I put in front of stakeholders, and immeasurably more confident in the ones I stand behind.</p><p>I am Oluwaseun Adeniran. I write about Data Analytics, SQL, Power BI, Machine Learning, and the real-world operational problems that come with building trust in data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e721e07e4bb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If My Dashboard Is Wrong?]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/what-if-my-dashboard-is-wrong-da4f9b7c3c0b?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/da4f9b7c3c0b</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[charts]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 10:01:09 GMT</pubDate>
            <atom:updated>2026-08-28T10:01:09.659Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcIFoeAYZ_8u9ibKFnoAkQ.jpeg" /><figcaption><a href="https://unsplash.com/illustrations/man-analyzing-stock-market-candlestick-chart-9MuVeJkaixI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Illustration</a> by <a href="https://unsplash.com/@revoltan/illustrations?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Makmun Arif</a> on <a href="https://unsplash.com/illustrations?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>There is one question I used to hate hearing after presenting a dashboard.</p><p>“Are you sure?”</p><p>Not because I didn’t know how I built the dashboard.</p><p>I did.</p><p>I knew where the data came from. I knew the measures I created. I knew which filters were applied and why I chose each visual.</p><p>But there is something about someone questioning a number you have spent hours working on that makes you question it too.</p><p>You look at the dashboard again.</p><p>Then the DAX.</p><p>Then the source data.</p><p>Then you start wondering whether you missed something obvious.</p><p>And that is where I think many analysts get confidence wrong.</p><p>We think confidence means being certain that our analysis is correct.</p><p>It doesn’t.</p><p>Confidence comes from knowing how to check.</p><h3>The number looked right</h3><p>Imagine you have built a sales dashboard.</p><p>Your headline KPI says:</p><p><strong>Total Revenue: £4.82M</strong></p><p>It looks reasonable.</p><p>The previous period was £4.35M, so an increase makes sense.</p><p>Your DAX measure is straightforward:</p><pre>Total Revenue =<br>SUM(Sales[Revenue])</pre><p>Nothing complicated.</p><p>You publish the dashboard.</p><p>Then someone asks:</p><p>“Does that include cancelled orders?”</p><p>You pause.</p><p>You know the answer should be no.</p><p>But did you actually check?</p><p>That is the difference between <em>thinking</em> your dashboard is right and <em>knowing</em> it is right.</p><p>The measure itself isn’t necessarily the problem.</p><p>The question is what data the measure is being allowed to see.</p><h3>This is where I stop trusting my eyes</h3><p>One of the easiest mistakes to make as an analyst is trusting a number because it looks believable.</p><p>A £4.82M revenue figure doesn’t look suspicious.</p><p>Neither does £4.91M.</p><p>Neither does £5.03M.</p><p>A wrong number doesn’t usually come with a warning saying:</p><p><strong>“Hello. I am incorrect.”</strong></p><p>It looks perfectly normal.</p><p>That is why I like to validate important numbers outside the visual itself.</p><p>For example, if my dashboard is supposed to exclude cancelled orders, I might go back to SQL:</p><pre>SELECT<br>    SUM(revenue) AS total_revenue<br>FROM sales<br>WHERE status = &#39;Completed&#39;;</pre><p>Then I compare that result with the Power BI measure.</p><p>If they match, good.</p><p>If they don’t, I have something to investigate.</p><p>And honestly, I would much rather discover that discrepancy while testing my dashboard than while presenting it to the CFO.</p><h3>Then DAX gets interesting</h3><p>Sometimes the SQL result is correct.</p><p>The source data is correct.</p><p>And your Power BI number is still wrong.</p><p>This is where things get uncomfortable.</p><p>Suppose you create:</p><pre>Average Revenue =<br>AVERAGE(Sales[Revenue])</pre><p>It works.</p><p>You put it on a card.</p><p>Then someone filters the dashboard to one region.</p><p>The number changes.</p><p>Good.</p><p>They filter again by product category.</p><p>It changes again.</p><p>Still good.</p><p>But what exactly is Power BI calculating?</p><p>That question matters because DAX doesn’t simply calculate a number.</p><p>It calculates a number <strong>inside a filter context</strong>.</p><p>And that context can change depending on where your measure is being used.</p><p>The same measure can produce different results on different visuals because the filters surrounding it are different.</p><p>This is one of those things that can make a new analyst feel like Power BI is deliberately trying to embarrass them.</p><p>It isn’t.</p><p>You just need to understand what context your calculation is operating in.</p><h3>Sometimes the mistake is not in the formula</h3><p>Let’s say your dashboard shows sales by region.</p><p>You have:</p><pre>Total Sales =<br>SUM(Sales[Revenue])</pre><p>Simple enough.</p><p>But your Region slicer isn’t affecting the number.</p><p>You could spend twenty minutes rewriting the measure.</p><p>You could add CALCULATE().</p><p>You could start experimenting with FILTER().</p><p>You could eventually produce a much more complicated formula.</p><p>Or you could look at the model.</p><p>Maybe the relationship between your Region table and Sales table isn’t behaving the way you assumed.</p><p>That is an important lesson I have learned:</p><p><strong>When a number looks wrong, don’t automatically rewrite the calculation.</strong></p><p>First ask what the calculation is actually receiving.</p><h3>I also check the grain</h3><p>This one has saved me more than once.</p><p>Imagine your SQL produces:</p><pre>SELECT<br>    SUM(order_value) AS revenue<br>FROM orders;</pre><p>You get:</p><p><strong>£2,000,000</strong></p><p>Then you join another table.</p><p>Suddenly:</p><p><strong>£2,430,000</strong></p><p>The query still runs.</p><p>There is no error.</p><p>SQL isn’t going to stop you and say:</p><p>“Are you sure you wanted to multiply your revenue?”</p><p>This is why I always want to understand the grain of the data before trusting an aggregation.</p><p>If one order can appear multiple times after a join, SUM() will happily add every occurrence.</p><p>The query can be syntactically perfect and analytically wrong.</p><p>That distinction is incredibly important.</p><h3>The question I ask before I defend a dashboard</h3><p>I don’t ask:</p><p><strong>“Does this dashboard look correct?”</strong></p><p>I ask:</p><p><strong>“What would make this dashboard wrong?”</strong></p><p>That question changes everything.</p><p>If the revenue number could be wrong because of duplicate rows, check duplicates.</p><p>If a monthly trend could be wrong because of the date relationship, check the relationship.</p><p>If a KPI could be wrong because cancelled orders are included, check the filter.</p><p>If a DAX measure behaves differently across visuals, investigate the filter context.</p><p>If the source and dashboard disagree, trace the calculation from the beginning.</p><p>You are no longer trying to prove that your dashboard is right.</p><p>You are actively trying to find out whether it is right.</p><p>That is a much healthier relationship with your own work.</p><h3>There is another kind of confidence</h3><p>I used to think the best analyst in the room was the person who could answer every question immediately.</p><p>I don’t think that anymore.</p><p>Sometimes the strongest answer is:</p><p>“I don’t know. Let me check.”</p><p>There is nothing embarrassing about that.</p><p>In fact, I would be more concerned about the analyst who always has an immediate explanation.</p><p>Because data has a funny way of punishing certainty.</p><p>You can have a perfect SQL query against the wrong table.</p><p>A perfect DAX measure against the wrong model.</p><p>A beautiful dashboard built from an incomplete dataset.</p><p>Technically correct work can still answer the wrong question.</p><h3>Before I present, I now try to break my own analysis</h3><p>Not literally, although some days it feels tempting.</p><p>I mean I deliberately look for reasons the conclusion might not hold.</p><p>If my dashboard says sales increased, I ask:</p><p><strong>Compared with what?</strong></p><p>If one region is performing better, I ask:</p><p><strong>Is that because it has more customers?</strong></p><p>If profit increased, I ask:</p><p><strong>Did the margin improve, or did we simply sell more?</strong></p><p>If a KPI suddenly jumps, I ask:</p><p><strong>What changed in the data?</strong></p><p>And if a stakeholder asks me where a number came from, I want to be able to trace it.</p><p>Source.</p><p>Transformation.</p><p>Model.</p><p>Calculation.</p><p>Visual.</p><p>If I can’t follow that path myself, I probably shouldn’t expect someone else to trust the result.</p><h3>You don’t need to be afraid of being wrong</h3><p>You are going to be wrong sometimes.</p><p>Every analyst is.</p><p>You will eventually publish something that needs correcting.</p><p>You will misunderstand a requirement.</p><p>You will write a DAX measure that looked perfect until someone applied a slicer you hadn’t considered.</p><p>You will join two tables and discover later that you accidentally changed the grain.</p><p>It happens.</p><p>The goal isn’t to become an analyst who never makes mistakes.</p><p>The goal is to become an analyst who catches mistakes before they become decisions.</p><p>That is a much higher standard.</p><p>And a much more achievable one.</p><h3>So, what if your dashboard is wrong?</h3><p>Check it.</p><p>Go back to the source.</p><p>Run the SQL.</p><p>Test the DAX.</p><p>Look at the model.</p><p>Question the assumptions.</p><p>Try to reproduce the number.</p><p>Then ask someone else to challenge your interpretation.</p><p>And if you find something wrong, fix it.</p><p>Don’t defend the dashboard simply because you built it.</p><p>The dashboard is not your work of art.</p><p>It is a tool.</p><p>Its job is to help someone understand what is happening well enough to make a better decision.</p><p>So perhaps confidence as an analyst isn’t saying:</p><p><strong>“My dashboard is right.”</strong></p><p>Perhaps it is being able to say:</p><p><strong>“I’ve done enough work to know why I believe it is right, and I know what I would check if it isn’t.”</strong></p><p>That is the kind of confidence worth having.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da4f9b7c3c0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dealing with Impostor Syndrome as a Data Analyst]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/dealing-with-impostor-syndrome-as-a-data-analyst-b2008132f08c?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2008132f08c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 10:28:37 GMT</pubDate>
            <atom:updated>2026-08-26T10:28:37.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjIuZYVKFcUSA1lBs5Majw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@christnerfurt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Christian Erfurt</a> on <a href="https://unsplash.com/photos/man-covering-face-with-both-hands-while-sitting-on-bench-sxQz2VfoFBE?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>There is a specific kind of quiet that happens in a meeting room right after you present a number, and someone leans forward and asks, are you sure about that.</p><p>I remember one meeting clearly. I had built a regional performance dashboard using a fairly standard star schema, one fact table for sales, dimension tables for region, product and date, with explicit measures for revenue and month-over-month comparison.</p><p>Nothing exotic. I had validated the totals against the source system before the meeting, checked the filter context on the visual, and confirmed the relationships were behaving the way I expected.</p><p>A director paused, looked at the screen, and asked me to confirm one figure showing a region underperforming against target.</p><p>Not aggressively. Just a simple question. And in that half second before I answered, my stomach dropped in a way that had nothing to do with the actual accuracy of the number.</p><p>I knew the model was right. I had done everything a careful analyst is supposed to do. And still, in that moment, I felt like a fraud sitting in front of people who trusted me to know exactly what I was talking about.</p><p>Nobody really prepares you for that feeling when you get into data work.</p><p>The confidence gap nobody warns you about</p><p>There is a strange thing that happens once you get reasonably good at building dashboards and writing DAX. People start trusting your numbers without checking the calculation behind them, which sounds like a compliment, and technically it is, but it also means the weight of being right sits entirely on you every single time, with no second pair of eyes standing between you and the boardroom.</p><p>Early on, I assumed confidence would arrive once I got technically competent enough. Learn enough DAX, understand filter context and relationship direction well enough, and eventually the nervous feeling before presenting a number would disappear on its own.</p><p>It did not work like that. If anything, the more responsibility I was given, the heavier that quiet self-doubt became, because the stakes of being wrong kept growing while nobody around me seemed to notice I was still nervous underneath it.</p><p>What actually made a difference</p><p>The thing that eventually helped was not becoming more technically skilled, although that mattered too. It was changing what I considered a successful outcome in a meeting.</p><p>I used to believe my job was to have the right answer instantly, every time, which meant every hesitation, every moment of needing to trace back through a calculation, felt like proof I did not belong in the room.</p><p>What actually changed things was accepting that my job was closer to being someone who can reconstruct a number reliably under pressure, not someone who has already memorised every figure before being asked. When that director questioned the number, the confident answer was not pretending I had it memorised.</p><p>It was saying, give me a moment, and I will show you exactly how this was calculated, then walking through the measure, the filters applied, and the grain of the underlying table.</p><p>That sentence did more for my actual confidence than any amount of additional DAX training ever did, because it stopped treating uncertainty as failure and started treating it as part of a process that holds up under scrutiny, if you are honest about it.</p><p>Building a habit that protects your confidence, not just your reports</p><p>I started keeping something close to a personal audit trail for every important number I presented. Not for anyone else. For me. A short note on how a figure was calculated, which measure it came from, which filters were applied, what assumptions sat underneath it, and a quick reconciliation check against the source data before it ever reached a dashboard.</p><p>It sounds like a small thing, but it changed how I walked into meetings. I was no longer relying purely on memory under pressure. If a question came, I had somewhere concrete to point to, a documented DAX expression, a row count check, a note on which relationship was active, and that made the difference between freezing and simply saying, let me walk you through it.</p><p>This is something I would genuinely encourage anyone early in their data career to build. Not because you will always need it. Because knowing it exists quietly removes a lot of the fear sitting underneath every presentation.</p><p>The part that took the longest to accept</p><p>The hardest lesson was realising that competent people get asked hard questions constantly, and being questioned is not a sign you have done something wrong. It is usually a sign the number matters enough for someone to actually care about it.</p><p>I used to interpret every follow up question as suspicion. Over time I noticed that the analysts and developers I respected most were not the ones who never got challenged. They were the ones who could open the model, point to the exact measure, explain the filter context in plain language, and respond calmly, without treating the question as an attack on their competence.</p><p>That shift did not happen overnight, and I will not pretend I never feel that small drop in my stomach anymore when someone questions a figure in front of a room. I still do, sometimes. What changed is what I do in the half second right after it happens, and how quickly I can actually prove the number is right rather than just insist that it is.</p><p>If any of this sounds familiar</p><p>If you have ever sat in a meeting knowing your work was correct and still felt like you had to prove it all over again, you are not the only one, and it does not mean you are in the wrong field. It usually means you care about getting it right, which is a very different thing from not being good enough.</p><p>I would genuinely like to hear how other analysts and developers have dealt with this, because I suspect a lot more of us feel it quietly than ever actually say so out loud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2008132f08c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Average Customer You’re Reporting On Doesn’t Exist]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/the-most-dangerous-number-in-data-analytics-is-the-average-39560ce40dce?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39560ce40dce</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 16:26:25 GMT</pubDate>
            <atom:updated>2026-08-28T10:13:26.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ij6zH-maRYpDq1Xy18ifcA.jpeg" /><figcaption>Photo by Volkan Olmez on Unsplash</figcaption></figure><p>I once sat in a meeting where someone pointed at a dashboard and said, great, so our typical customer spends around a hundred pounds. Let’s build the next campaign around that.</p><p>I remember pausing before answering, because technically, the number on the screen was correct. Average customer spend, £106. I had built the measure myself. I had checked it twice.</p><p>And not a single customer in that dataset actually spent £106.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tS1qQqQrbhZEXJmsL6gKGA.png" /></figure><p>£20, £25, £30, £35, £40, £45, £50, £55, £60, and one customer at £700. Add it up, divide by ten, and you land on £106. The maths is flawless. The story it tells the room is almost entirely wrong.</p><p>The median for that same group is £42.50. Both numbers are correct. Only one gives you a reasonable idea of what a typical customer actually spends, and it’s not the one that usually ends up on the dashboard.</p><p>That’s the moment I started being properly suspicious of the average. Not because it’s mathematically wrong. It never is. It’s dangerous because we’re very good at handing it more meaning than it actually earned.</p><h3>The average is doing exactly what you asked it to do</h3><p>Let’s be fair to the average.</p><p>It has done nothing wrong.</p><p>Add everything together. Divide by the number of observations. You get the mean.</p><p>In our example:</p><pre>£20 + £25 + £30 + £35 + £40<br>+ £45 + £50 + £55 + £60 + £700<br>= £1,060</pre><pre>£1,060 ÷ 10 = £106</pre><p>Perfectly correct.</p><p>The problem begins when someone says:</p><blockquote><em>“So the typical customer spends about £106.”</em></blockquote><p>No.</p><p>That’s not what the calculation told you.</p><p>One customer spending £700 pulled the average away from almost everyone else.</p><p>And this happens everywhere in analytics.</p><p>Salary.</p><p>Customer spending.</p><p>Delivery times.</p><p>Website sessions.</p><p>House prices.</p><p>Transaction values.</p><p>Response times.</p><p>The number can be perfectly accurate while the story built around it is completely misleading.</p><h3>One number can hide an entire distribution</h3><p>This is one of the reasons I think analysts should be slightly suspicious whenever a report gives them a single summary number.</p><p>Say someone hands you a report showing average delivery time at 42 minutes. Sounds fine. Should you actually be pleased about that?</p><pre>20  22  24  25  26  27  28  29  31  35  40  43  47  51  75  95</pre><p>Now the question becomes much more interesting.</p><p>Are customers generally waiting around 42 minutes?</p><p>Or are most deliveries arriving much sooner, with a smaller number of very late deliveries pulling the average upward?</p><p>You cannot answer that from the average alone.</p><p>This is the problem with aggregation.</p><p><strong>It makes data easier to communicate by removing information.</strong></p><p>Sometimes that’s exactly what we need.</p><p>Sometimes the information it removes is the entire story.</p><h3>This is where the median becomes useful</h3><p>The median simply asks:</p><blockquote><em>What value sits in the middle when the observations are ordered?</em></blockquote><p>For our customer example:</p><pre>£20  £25  £30  £35  £40  £45  £50  £55  £60  £700<br>                         ↑<br>                    middle values</pre><p>There are 10 observations, so we take the middle two:</p><pre>(£40 + £45) ÷ 2 = £42.50</pre><p>Now we have:</p><p><strong>Mean: £106</strong></p><p><strong>Median: £42.50</strong></p><p>Again, neither number is inherently “better”.</p><p>They answer different questions.</p><p>The mean tells us the average amount across all customers.</p><p>The median gives us a much better sense of the middle customer in this particular distribution.</p><p>That difference matters.</p><h3>And then there is the average of averages</h3><p>This one catches people out.</p><p>Imagine two marketing channels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4GZOuSp8a5K8iCWkOcBLNA.png" /></figure><p>Someone might look at the two conversion rates and calculate:</p><pre>(50% + 10%) ÷ 2 = 30%</pre><p>So the average conversion rate is 30%.</p><p>Except it isn’t.</p><p>Across both channels:</p><pre>Total visitors = 1,010</pre><pre>Total conversions = 105</pre><pre>Overall conversion rate<br>= 105 ÷ 1,010<br>= 10.4%</pre><p>That’s a very different story.</p><p>Why?</p><p>Because Channel A and Channel B don’t represent the same number of visitors.</p><p>Treating their percentages as equally important throws away that information.</p><p>This is why you have to understand <strong>what you are averaging before you average it.</strong></p><h3>The same problem appears in business reporting</h3><p>Let’s say a company reports:</p><p><strong>Average employee salary: £52,000</strong></p><p>That number might be perfectly legitimate.</p><p>But it doesn’t tell you whether most employees earn somewhere around £52,000.</p><p>Perhaps the organisation actually looks more like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jh0r2PtAzVT8-u4xWiPsBg.png" /></figure><p>I’ve watched a leadership team look at exactly this figure and conclude, our people are clearly well paid. Nobody in that room had seen the breakdown sitting underneath it.</p><p>A useful analysis might need to separate employees by role, experience, location, department or another meaningful dimension.</p><p>The answer isn’t always a more sophisticated statistical technique.</p><p>Sometimes you simply need to <strong>stop averaging everyone together.</strong></p><h3>This is why segmentation matters</h3><p>Averages become much more useful when you start asking:</p><p><strong>Average for whom?</strong></p><p>Average revenue across all customers?</p><p>Fine.</p><p>But what happens when you split customers into:</p><pre>New customers<br>Returning customers<br>High-value customers<br>Low-value customers<br>Enterprise customers<br>Individual customers</pre><p>You may discover that the overall average was hiding completely different behaviours.</p><p>The same thing happens with geography.</p><p>The same thing happens with products.</p><p>The same thing happens with age groups.</p><p>The same thing happens with time.</p><p>The moment you break a population into meaningful groups, the “average” can change dramatically.</p><p>And sometimes that change is the insight.</p><h3>So should we stop using averages?</h3><p>Absolutely not.</p><p>That would be another oversimplification.</p><p>The mean is incredibly useful.</p><p>If I want to know the average revenue generated per transaction across a period, the mean may be exactly what I need.</p><p>If I’m calculating expected costs across a large population, the mean can be extremely informative.</p><p>If I’m comparing groups under the right conditions, averages can make patterns much easier to see.</p><p>The lesson isn’t:</p><p><strong>“Never use the average.”</strong></p><p>It’s:</p><p><strong>“Don’t let the average end the analysis.”</strong></p><p>Before reporting it, understand what sits underneath it.</p><h3>Five questions I ask before trusting an average</h3><p>When I see an average in a report, I want to know a little more.</p><p><strong>1. What does the distribution look like?</strong></p><p>Are the values clustered together or spread all over the place?</p><p><strong>2. Are there extreme values?</strong></p><p>One unusually large or small observation can have a huge effect on the mean.</p><p><strong>3. Who is included?</strong></p><p>An overall average can hide meaningful differences between groups.</p><p><strong>4. What does the median tell us?</strong></p><p>If the mean and median are dramatically different, that’s worth investigating.</p><p><strong>5. Does this number actually answer the question?</strong></p><p>This is probably the most important one.</p><p>Because sometimes the problem isn’t choosing between mean and median.</p><p>Sometimes the problem is that <strong>average was never the right metric in the first place.</strong></p><h3>The number isn’t the story</h3><p>This is probably the biggest lesson I’ve taken from working with data.</p><p>We like numbers because they feel objective.</p><p>Put a number on a dashboard and suddenly something feels settled.</p><p><strong>£106.</strong></p><p><strong>42 minutes.</strong></p><p><strong>52% conversion.</strong></p><p><strong>£52,000 salary.</strong></p><p>But a number doesn’t automatically explain what happened.</p><p>It is a summary of something much larger.</p><p>And every time we summarise data, we make a choice about what to keep and what to leave out.</p><p>That’s why I think good analysis requires a little healthy suspicion.</p><p>Don’t just ask:</p><blockquote><em>“What’s the average?”</em></blockquote><p>Ask:</p><blockquote><strong><em>“What is this average hiding?”</em></strong></blockquote><p>Look at the distribution.</p><p>Break down the groups.</p><p>Check the extremes.</p><p>Compare the mean with the median.</p><p>Then decide whether the number actually helps answer the question you started with.</p><p>Because sometimes the most important thing about an average isn’t the number it gives you.</p><p><strong>It’s everything it leaves out.</strong></p><p>If you’ve ever found a perfectly reasonable average hiding a completely different story, I’d genuinely like to hear about it. Those are usually the analyses worth remembering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39560ce40dce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You’re Probably Approaching Machine Learning All Wrong]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/youre-probably-approaching-machine-learning-all-wrong-02d201db8cc6?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/02d201db8cc6</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 10:39:16 GMT</pubDate>
            <atom:updated>2026-08-20T10:39:16.795Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zs5S5j3-GTFLRf_PQKUpsQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@adibbehrooz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mohammad Bagher Adib Behrooz</a> on <a href="https://unsplash.com/photos/woman-on-building-XHI-S_xWK28?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>There is a moment in almost every machine learning project when the notebook starts looking impressive.</p><p>The model trains.</p><p>The predictions come out.</p><p>The accuracy is respectable.</p><p>Then you try another algorithm and the number gets a little better.</p><p>So you try another one.</p><p>Then you tune a few hyperparameters.</p><p>Maybe you scale the features. Remove a few columns. Add some more. Run cross validation. Plot a confusion matrix. Try XGBoost because someone on YouTube said it works really well.</p><p>At some point, you look at your screen and think:</p><p><strong>This is machine learning. I’m doing it.</strong></p><p>You download a dataset.</p><p>You clean it.</p><p>You split it into train and test sets.</p><p>Then comes the exciting part.</p><p>You start trying models.</p><p>Logistic Regression.</p><p>Decision Tree.</p><p>Random Forest.</p><p>XGBoost.</p><p>Maybe even a neural network, because at this point, why not?</p><p>You compare the scores.</p><p>92%.</p><p>94%.</p><p>96%.</p><p>You tune some hyperparameters.</p><p>96.4%.</p><p>You feel like you’re getting somewhere.</p><p>But there is a question I think we should ask much earlier in the process:</p><p><strong>What exactly are we optimising?</strong></p><p>Because a machine learning project can have an impressive model, a beautiful notebook and a very good accuracy score and still be a poor solution.</p><p>The problem is not necessarily the algorithm.</p><p>It is the order in which we approach the problem.</p><h3>The machine learning workflow I wish more beginners started with</h3><p>A lot of beginner projects effectively look like this:</p><pre>Dataset<br>   ↓<br>Clean data<br>   ↓<br>Train models<br>   ↓<br>Compare accuracy<br>   ↓<br>Tune best model<br>   ↓<br>Deploy</pre><p>It looks reasonable.</p><p>But there are some very important questions missing.</p><p>A more useful workflow looks like this:</p><pre>BUSINESS / REAL WORLD PROBLEM<br>             ↓<br>       What are we predicting?<br>             ↓<br>       What decision will it support?<br>             ↓<br>       What data would exist at prediction time?<br>             ↓<br>       Build a simple baseline<br>             ↓<br>       Choose the right evaluation metric<br>             ↓<br>       Train candidate models<br>             ↓<br>       Compare against the baseline<br>             ↓<br>       Check errors and failure cases<br>             ↓<br>       Decide whether the improvement matters<br>             ↓<br>       Deploy and monitor</pre><p>Notice what is deliberately missing from the beginning.</p><p><strong>XGBoost.</strong></p><p>That is not because XGBoost is bad.</p><p>It is because the algorithm should not be the first interesting decision you make.</p><h3>Start with the question, not the model</h3><p>Imagine a company wants to predict customer churn.</p><p>A beginner might immediately think:</p><blockquote><em>“This is a classification problem. I’ll try Random Forest and XGBoost.”</em></blockquote><p>Technically, yes.</p><p>But I would want to know something else first.</p><p><strong>What happens when the model predicts that somebody will churn?</strong></p><p>Perhaps the company contacts that customer.</p><p>Perhaps it offers a retention incentive.</p><p>Perhaps the customer gets moved into a different campaign.</p><p>Now we have a much more interesting problem.</p><p>The model isn’t simply predicting churn.</p><p>It is helping decide <strong>who should receive an intervention</strong>.</p><p>That changes how we think about the entire project.</p><p>Suddenly, false positives and false negatives have different consequences.</p><p>And that brings us to one of the biggest traps in machine learning.</p><h3>Accuracy can make a bad model look good</h3><p>Consider a fraud detection problem.</p><p>Suppose we have:</p><p>TransactionNumberTotal transactions100,000Fraudulent2,000Legitimate98,000</p><p>Now imagine a completely useless model that predicts:</p><pre>Every transaction = NOT FRAUD</pre><p>It catches zero fraudulent transactions.</p><p>And yet:</p><pre>Accuracy = 98%</pre><p>That number looks fantastic until you ask what the model actually accomplished.</p><p>Nothing.</p><p>This is why the evaluation metric needs to come from the problem, not from whatever metric happens to be easiest to calculate.</p><p>For classification problems, you might need to examine:</p><pre>Accuracy<br>Precision<br>Recall<br>F1 score<br>ROC AUC<br>PR AUC<br>Confusion matrix</pre><p>And the right choice depends on what errors matter.</p><h3>The confusion matrix tells a much better story</h3><p>Suppose our fraud model produces this:</p><p>Actually fraudActually legitimatePredicted fraud1,6004,000Predicted legitimate40094,000</p><p>Now we can actually ask useful questions.</p><p>How many fraudulent transactions did we catch?</p><p>How many legitimate customers did we wrongly flag?</p><p>How many fraudulent transactions slipped through?</p><p>That is much more informative than saying:</p><blockquote><em>“The model achieved 95.6% accuracy.”</em></blockquote><p>The score is not useless.</p><p>It is simply not the whole story.</p><h3>Then there is the data problem</h3><p>This is where things get uncomfortable.</p><p>Your model may not be the thing you need to improve.</p><p>Your data might be.</p><p>Imagine you’re building a model to predict whether a patient will be readmitted.</p><p>You have hundreds of possible features.</p><p>Age.</p><p>Diagnosis.</p><p>Previous admissions.</p><p>Length of stay.</p><p>Medication.</p><p>Discharge information.</p><p>And eventually you discover a feature that gives your model a huge performance boost.</p><p>Fantastic.</p><p>Except the feature is only recorded <strong>after discharge</strong>.</p><p>Your model now looks brilliant because you accidentally gave it information that would not exist when the prediction needs to be made.</p><p>That is data leakage.</p><p>And no amount of hyperparameter tuning will fix it.</p><p>The better question is:</p><blockquote><strong><em>Could I actually know this information at the moment I am supposed to make the prediction?</em></strong></blockquote><p>If the answer is no, the feature should not be there.</p><h3>Build a baseline before building something complicated</h3><p>This is one of the simplest habits that can completely change how you evaluate an ML project.</p><p>Before building the sophisticated model, build something embarrassingly simple.</p><p>For classification:</p><pre>from sklearn.dummy import DummyClassifier</pre><pre>baseline = DummyClassifier(strategy=&quot;most_frequent&quot;)<br>baseline.fit(X_train, y_train)</pre><pre>baseline_score = baseline.score(X_test, y_test)</pre><p>Then compare your real model against it.</p><p>For regression, you could establish a simple baseline such as predicting the mean of the target.</p><p>The point isn’t that the baseline should be good.</p><p>The point is that <strong>you need to know what “better” actually means.</strong></p><p>Suppose you get:</p><p>ModelF1 ScoreBaseline0.51Logistic Regression0.68Random Forest0.71XGBoost0.72</p><p>Now we have a meaningful progression.</p><p>But imagine this instead:</p><p>ModelF1 ScoreBaseline0.69Logistic Regression0.70Random Forest0.71XGBoost0.71</p><p>Suddenly that complicated model looks much less exciting.</p><p>And that is useful information.</p><h3>Stop treating model complexity as progress</h3><p>There is a point where machine learning projects become competitions between algorithms.</p><p>“Random Forest gave me 89%.”</p><p>“Mine gave me 91%.”</p><p>“I used XGBoost and got 93%.”</p><p>Okay.</p><p>But what changed?</p><p>Did the model solve the business problem better?</p><p>Did it reduce costly errors?</p><p>Did it improve recall where recall mattered?</p><p>Did it make predictions faster?</p><p>Did it become harder to explain?</p><p>Did it require significantly more computational resources?</p><p>Did the extra 2% actually matter?</p><p>This is the part that gets lost when we focus too heavily on the leaderboard.</p><p>A model is not automatically better because it is more complicated.</p><h3>A simple model can be the right model</h3><p>Suppose you have this result:</p><p>ModelPerformanceInterpretabilityComplexityLogistic Regression89%HighLowRandom Forest91%MediumMediumXGBoost92%LowerHigh</p><p>Which one wins?</p><p>There isn’t enough information to answer that.</p><p>If the extra 3% prevents serious losses, XGBoost might be worth it.</p><p>If the model needs to be easily explained to decision makers, logistic regression might be preferable.</p><p>If the difference between 91% and 92% has almost no practical consequence, adding complexity may not be worth it.</p><p><strong>The highest score is not automatically the winner.</strong></p><p>The best model is the one that makes sense for the problem.</p><h3>And please don’t forget the errors</h3><p>This is probably one of the most useful things you can do after training a model.</p><p>Don’t just look at:</p><pre>model.score(X_test, y_test)</pre><p>Look at where the model gets things wrong.</p><p>For a classifier:</p><pre>from sklearn.metrics import confusion_matrix</pre><pre>predictions = model.predict(X_test)</pre><pre>cm = confusion_matrix(y_test, predictions)</pre><pre>print(cm)</pre><p>Then investigate those cases.</p><p>Are certain groups consistently misclassified?</p><p>Are errors concentrated around particular values?</p><p>Are there categories where the model performs badly?</p><p>Are false positives much more common than false negatives?</p><p>The errors can tell you something your headline metric cannot.</p><p>Sometimes the next improvement isn’t another model.</p><p>It is understanding <strong>why your current model is wrong.</strong></p><h3>The part of machine learning nobody puts in the portfolio screenshot</h3><p>This is the bit I think gets overlooked.</p><p>A portfolio project usually ends with something like:</p><pre>Model: Random Forest<br>Accuracy: 94.2%</pre><p>Maybe there is a confusion matrix.</p><p>Maybe a feature importance chart.</p><p>And that’s it.</p><p>But a real machine learning system has another half.</p><pre>MODEL<br>                  ↓<br>             PREDICTION<br>                  ↓<br>             DECISION<br>                  ↓<br>              ACTION<br>                  ↓<br>             OUTCOME<br>                  ↓<br>             MONITORING<br>                  ↓<br>             NEW DATA<br>                  ↓<br>               MODEL</pre><p>The model is part of the system.</p><p>It isn’t the entire system.</p><p>A model that performs beautifully in a notebook but cannot be maintained, monitored or used properly is not necessarily a successful machine learning solution.</p><h3>So what should you actually optimise?</h3><p>Not accuracy.</p><p>Not complexity.</p><p>Not the number of algorithms in your notebook.</p><p>Not how impressive your GitHub repository looks.</p><p>Start by optimising for <strong>the decision the model is supposed to improve</strong>.</p><p>Then ask:</p><pre>1. Is this actually a machine learning problem?<br>                 ↓<br>2. Is the data appropriate?<br>                 ↓<br>3. Is there leakage?<br>                 ↓<br>4. What would a simple baseline achieve?<br>                 ↓<br>5. Which errors matter most?<br>                 ↓<br>6. Which metric reflects those errors?<br>                 ↓<br>7. Does the model meaningfully beat the baseline?<br>                 ↓<br>8. Are the improvements worth the added complexity?<br>                 ↓<br>9. What happens after prediction?</pre><p>Only then would I worry about squeezing another 0.5% out of the model.</p><p>Because there is something strangely satisfying about a model that achieves 97% accuracy.</p><p>But there is something much more satisfying about knowing <strong>why 97% matters.</strong></p><p>And that, to me, is the difference between building a machine learning model and actually doing machine learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02d201db8cc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Don’t Need Python. You Need Better SQL]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/you-dont-need-python-you-need-better-sql-84821138bf7d?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/84821138bf7d</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 12:18:06 GMT</pubDate>
            <atom:updated>2026-08-18T12:18:06.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiFIvZnjzArj7wS1cGippw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@yancymin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Yancy Min</a> on <a href="https://unsplash.com/photos/a-close-up-of-a-text-description-on-a-computer-screen-842ofHC6MaI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Every few months, a post goes around telling analysts they need Python, or they’ll get left behind.</p><p>I want to push back on that with actual examples, not just an opinion. Because most of the SQL problems I see analysts avoid aren’t hard. They’re just unfamiliar, and Python quietly becomes the detour around them.</p><p>Here’s what I mean.</p><p><strong>The month-over-month calculation everyone overcomplicates</strong></p><p>Ask an analyst to show revenue compared to the previous month, and a surprising number reach straight for Python, or worse, a self-join.</p><pre>SELECT<br>    a.month,<br>    a.revenue,<br>    a.revenue - b.revenue AS revenue_change<br>FROM monthly_sales a<br>JOIN monthly_sales b<br>    ON a.month = DATEADD(month, 1, b.month)</pre><p>It works. It’s also slow, hard to read, and gets worse the moment someone wants a rolling three-month average on top of it.</p><p>Here’s the same thing with a window function.</p><pre>SELECT<br>    month,<br>    revenue,<br>    revenue - LAG(revenue) OVER (ORDER BY month) AS revenue_change<br>FROM monthly_sales</pre><p>One pass over the data. No join. No duplicated rows to worry about. Once you’re comfortable with LAG, LEAD and OVER, an entire category of “I need Python for this” problems disappears, because this is exactly the kind of comparison most business questions actually need.</p><p><strong>The join that quietly duplicates your revenue</strong></p><p>This one costs real money, and I’ve seen it happen more than once.</p><p>Say you’re joining a customers table to an orders table to report total revenue by region.</p><pre>SELECT<br>    c.region,<br>    SUM(o.order_value) AS total_revenue<br>FROM customers c<br>JOIN orders o ON c.customer_id = o.customer_id<br>GROUP BY c.region</pre><p>Looks completely reasonable. But if a customer has multiple addresses stored across several rows in a related table you joined earlier in the pipeline, this query can silently fan out, multiplying each order by however many address rows that customer has. Revenue inflates. Nobody notices until finance asks why the dashboard doesn’t match the accounting system.</p><p>The fix isn’t Python. It’s checking your grain before you aggregate.</p><pre>SELECT<br>    c.customer_id,<br>    COUNT(*) AS row_count<br>FROM customers c<br>JOIN orders o ON c.customer_id = o.customer_id<br>GROUP BY c.customer_id<br>HAVING COUNT(*) &gt; (SELECT COUNT(*) FROM orders WHERE customer_id = c.customer_id)</pre><p>That single diagnostic query, run before you trust any aggregation, catches fan-out before it reaches a stakeholder’s inbox. This is the kind of thing that separates analysts who get quietly trusted with important numbers from analysts who don’t.</p><p><strong>Nested subqueries versus a CTE, side by side</strong></p><p>Here’s a query I see constantly, usually written by someone under deadline pressure.</p><pre>SELECT region, total_revenue<br>FROM (<br>    SELECT region, SUM(revenue) AS total_revenue<br>    FROM (<br>        SELECT o.region, o.revenue<br>        FROM orders o<br>        WHERE o.status = &#39;completed&#39;<br>    ) t1<br>    GROUP BY region<br>) t2<br>WHERE total_revenue &gt; 100000</pre><p>Technically correct. Practically unreadable six weeks later, including by the person who wrote it.</p><pre>WITH completed_orders AS (<br>    SELECT region, revenue<br>    FROM orders<br>    WHERE status = &#39;completed&#39;<br>),<br>regional_totals AS (<br>    SELECT region, SUM(revenue) AS total_revenue<br>    FROM completed_orders<br>    GROUP BY region<br>)<br>SELECT region, total_revenue<br>FROM regional_totals<br>WHERE total_revenue &gt; 100000</pre><p>Same result. Completely different experience for the next person who opens this file, including future you. CTEs read top to bottom like a sentence. Nested subqueries read inside out, like unwrapping a parcel to find another parcel.</p><p><strong>Before and after, at a glance</strong></p><p>Problem The Python detour The SQL answer Month over month comparison Pandas shift() in a notebook LAG() OVER (ORDER BY month) Revenue inflated after a join Rebuild the pipeline in pandas Check grain with a row count diagnostic before aggregating Unreadable nested query Rewrite the whole thing in Python WITH clauses, one step at a time Query feels slow Assume the database can’t handle it Check the execution plan before assuming anything</p><p>That last row matters more than people think. Before blaming the database, actually look at what it’s doing.</p><pre>EXPLAIN ANALYZE<br>SELECT * FROM orders WHERE customer_id = 4821</pre><p>If that comes back showing a full table scan on a table with millions of rows, the fix is very likely a missing index, not a rewrite in another language entirely.</p><pre>CREATE INDEX idx_orders_customer_id ON orders (customer_id)</pre><p>One line. Query goes from scanning every row to jumping straight to the ones that matter. I have watched this single fix turn a forty-second query into something that returns instantly, with zero Python involved anywhere.</p><p><strong>Where Python genuinely does earn its place</strong></p><p>None of this means Python is pointless. If you actually need prediction, need to process something too messy for SQL to handle cleanly, or need automation beyond what a scheduled job can do, Python is the right tool and no amount of SQL fixes can replace that.</p><p>The point isn’t Python bad, SQL good. The point is sequencing. Get properly fluent in the language your data already lives in before reaching for the one that feels more exciting. The analysts who get trusted with the important numbers aren’t the ones with the flashiest stack. They’re the ones who can be handed a messy question and come back with the right answer, the first time, without three follow-up meetings to explain what went sideways.</p><p>If you’ve got a SQL problem that made you reach for Python before you’d properly tried to solve it in the database, I’d genuinely like to hear it. I’m curious how often that pattern shows up outside my own experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84821138bf7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your DAX Isn’t Wrong, Here’s Why]]></title>
            <link>https://medium.com/@adeniranmichaelelvis/your-dax-isnt-wrong-but-it-returns-blank-e424bf9e057d?source=rss-c43fbc64443b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e424bf9e057d</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Oluwaseun Adeniran]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 12:13:14 GMT</pubDate>
            <atom:updated>2026-08-18T12:10:48.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDYQ20DixkZi9OD1x76FVA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Christopher Gower</a> on <a href="https://unsplash.com/photos/a-macbook-with-lines-of-code-on-its-screen-on-a-busy-desk-m_HRfLhgABo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>You have rewritten the same measure three times now.</p><p>Each version is technically cleaner than the last. Better syntax. Better naming. You have even added a comment explaining what it does, which is more than most people bother with. Each version is technically cleaner than the last. Better syntax. Better naming.</p><p>You have even added a comment explaining what it does, which is more than most people bother with.</p><p>Power BI gives you the satisfying little green tick.</p><p>No errors.</p><p>You add the measure to a visual and…</p><p><strong>BLANK.</strong></p><p>Not zero. Not an error. Just nothing.</p><p>So you check the formula again. It looks fine. You check the column names. Fine. You refresh the data. Still blank.</p><p>This is one of those Power BI problems that can make you question your entire existence as a data analyst.</p><p>But a blank measure does not necessarily mean your DAX is wrong.</p><p>More often, it means <strong>your measure is being evaluated in a context you weren’t expecting.</strong></p><p>And that is where debugging gets interesting.</p><p>Here are five things I check when a Power BI measure unexpectedly returns BLANK.</p><h3>1. Check the filter context first</h3><p>This is usually where I start.</p><p>A DAX measure does not simply calculate its formula against the entire table. It evaluates that formula within the <strong>current filter context</strong>.</p><p>That context can come from slicers, filters, rows and columns in a visual, relationships between tables, and even other measures.</p><p>Take a simple measure:</p><pre>Total Sales =<br>SUM(Sales[SalesAmount])</pre><p>On a card, this might show:</p><p><strong>£2.3M</strong></p><p>Put the same measure into a table broken down by product and each row gets its own result.</p><p>Nothing about the DAX changed.</p><p>The <strong>context</strong> did.</p><p>This becomes important when your measure contains conditions.</p><p>For example:</p><pre>Sales Target Met =<br>IF(<br>    [Total Sales] &gt;= 100000,<br>    &quot;Yes&quot;,<br>    BLANK()<br>)</pre><p>If the current filter context produces sales below £100,000, the measure deliberately returns BLANK.</p><p>That sounds obvious.</p><p>But when you’re staring at an empty visual, it’s surprisingly easy to start rewriting the measure before checking what Power BI is actually filtering.</p><h3>A useful debugging trick</h3><p>Create a temporary measure:</p><pre>Debug Sales =<br>[Total Sales]</pre><p>Put it beside the problem measure in the same visual.</p><p>If Debug Sales also returns BLANK, your problem may be upstream of the original calculation.</p><p>If it returns a value, you know the underlying sales measure is working and you can investigate the additional logic.</p><p>Sometimes the fastest way to fix DAX is to <strong>stop looking at the complicated measure for a minute.</strong></p><h3>2. Your relationship might be the problem</h3><p>This one catches people because the DAX can be completely correct.</p><p>Imagine you have:</p><p><strong>Customers</strong></p><p>CustomerIDCustomer101John102Sarah103David</p><p>And:</p><p><strong>Sales</strong></p><p>CustomerIDSales101500102800103300</p><p>You expect a customer slicer to filter your sales.</p><p>But if the relationship between the tables is missing, inactive or configured incorrectly, the filter may not travel where you expect it to.</p><p>Your measure:</p><pre>Total Sales =<br>SUM(Sales[Sales])</pre><p>isn’t necessarily the problem.</p><p>The model is.</p><p>This is why I would always ask:</p><blockquote><strong><em>Is the filter actually reaching the table my measure is calculating from?</em></strong></blockquote><p>If you select a customer and your sales number doesn’t change, don’t immediately rewrite the measure.</p><p>Look at the model.</p><h3>3. SELECTEDVALUE can quietly return BLANK</h3><p>SELECTEDVALUE() is incredibly useful.</p><p>It’s also responsible for quite a few confusing blank results.</p><p>Suppose you write:</p><pre>Selected Region =<br>SELECTEDVALUE(Region[Region])</pre><p>This works beautifully when exactly one region is selected.</p><p>But what happens when the user selects:</p><ul><li>West</li><li>East</li><li>South</li></ul><p>at the same time?</p><p>There isn’t one selected value anymore.</p><p>So SELECTEDVALUE() can return BLANK.</p><p>You can provide an alternative result:</p><pre>Selected Region =<br>SELECTEDVALUE(<br>    Region[Region],<br>    &quot;Multiple regions&quot;<br>)</pre><p>Now your measure has somewhere to go when there isn’t a single value.</p><p>This is especially useful in dynamic titles, calculations and measures that depend on one particular selection.</p><p>The important thing is not to assume that SELECTEDVALUE() means &quot;give me whatever is selected.&quot;</p><p>It really means:</p><blockquote><strong><em>Give me the value when there is exactly one distinct value in the current context.</em></strong></blockquote><p>That distinction matters.</p><h3>4. Check your dates and filters</h3><p>Dates cause an enormous amount of confusion in Power BI.</p><p>You might have a perfectly valid measure:</p><pre>Total Sales =<br>SUM(Sales[SalesAmount])</pre><p>Then someone adds a year slicer.</p><p>Suddenly the visual is blank.</p><p>Before touching the measure, check whether the selected date actually has matching rows in the data.</p><p>This is particularly important when you’re working with:</p><ul><li>Separate date tables</li><li>Date relationships</li><li>Multiple date columns</li><li>Inactive relationships</li><li>Custom calendars</li><li>Date fields stored with unexpected data types</li></ul><p>For example, your sales table might contain dates from January to December, while the date table being used by the slicer contains a completely different range.</p><p>The measure hasn’t suddenly stopped working.</p><p>The filter simply isn’t finding any matching rows.</p><p>A quick diagnostic measure can help:</p><pre>Sales Rows =<br>COUNTROWS(Sales)</pre><p>Put it into the same visual and apply the same filters.</p><p>If the result drops to zero, you’ve learned something useful.</p><p><strong>The problem isn’t necessarily the calculation. There may simply be no rows left to calculate.</strong></p><h3>5. Your measure works in one visual but not another</h3><p>This is probably the most confusing version of the problem.</p><p>You create a measure.</p><p>It works perfectly in a card.</p><p>Then you put it into a table.</p><p>BLANK.</p><p>Or it works by month but disappears when you add product.</p><p>What happened?</p><p>The visual changed the <strong>filter context</strong>.</p><p>Consider:</p><pre>Average Sales =<br>AVERAGE(Sales[SalesAmount])</pre><p>On a card, you’re asking:</p><blockquote><em>What is the average across the current dataset?</em></blockquote><p>In a table grouped by product, you’re effectively asking:</p><blockquote><em>What is the average for this particular product under the current filters?</em></blockquote><p>Those are different questions.</p><p>This is why copying a measure from one visual into another and expecting exactly the same result can be misleading.</p><p>The formula stayed the same.</p><p><strong>The question Power BI was asking it changed.</strong></p><h3>My five-minute BLANK checklist</h3><p>When a measure suddenly disappears, I wouldn’t rewrite the DAX immediately.</p><p>I’d work through this:</p><p>CheckQuestion<strong>1. Filter context</strong>What filters are active in this visual?<strong>2. Relationships</strong>Is the filter reaching the table I need?<strong>3. SELECTEDVALUE</strong>Am I actually dealing with one value?<strong>4. Dates</strong>Does the selected date range contain matching data?<strong>5. Visual context</strong>Does the measure behave differently when grouped by another field?</p><p>Then simplify.</p><p>Take the complicated measure and strip it back to something you know should return a value.</p><p>For example:</p><pre>Debug Count =<br>COUNTROWS(Sales)</pre><p>Then:</p><pre>Debug Sales =<br>SUM(Sales[SalesAmount])</pre><p>Then gradually add the original logic back.</p><p>It’s much easier to find the broken piece when you’re adding one thing at a time than when you’re staring at a 20-line DAX measure wondering which part decided to ruin your afternoon.</p><h3>BLANK doesn’t always mean something is broken</h3><p>This is probably the most important point.</p><p>A BLANK result isn’t automatically an error.</p><p>Sometimes BLANK is exactly what the measure is supposed to return.</p><p>For example:</p><pre>Profit Margin =<br>IF(<br>    [Sales] = 0,<br>    BLANK(),<br>    DIVIDE([Profit], [Sales])<br>)</pre><p>If there are no sales, showing a blank may be more meaningful than displaying a misleading percentage.</p><p>So before asking:</p><blockquote><em>“Why is Power BI returning BLANK?”</em></blockquote><p>also ask:</p><blockquote><strong><em>“Should there actually be a value here?”</em></strong></blockquote><p>That small change in thinking can save a surprising amount of debugging time.</p><h3>Don’t rewrite the measure yet</h3><p>When a Power BI measure returns BLANK, the temptation is to start changing the DAX.</p><p>Add another CALCULATE.</p><p>Throw in FILTER.</p><p>Try ALL.</p><p>Maybe REMOVEFILTERS() will magically save the day.</p><p>We’ve all been there.</p><p>But DAX isn’t always the first place to look.</p><p>Sometimes the measure is fine.</p><p>The filter context is wrong.</p><p>Sometimes the relationship is wrong.</p><p>Sometimes the selected date has no data.</p><p>Sometimes SELECTEDVALUE() doesn&#39;t have a single value to return.</p><p>And sometimes the blank is actually the correct answer.</p><p><strong>Before rewriting the measure, find out what Power BI is being asked to calculate.</strong></p><p>That is usually where the real answer starts.</p><p>If you regularly work with Power BI and DAX, you’ve probably had a measure return BLANK at the exact moment you were convinced everything was working.</p><p><strong>What’s the first thing you check when that happens?</strong></p><p>I’d genuinely be interested to hear how you debug it.</p><p>Hi, I’m Oluwaseun Adeniran. I write about Power BI, DAX, data analysis and machine learning, with a focus on the practical problems analysts and BI developers actually run into. Follow for more practical data and Power BI insights.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e424bf9e057d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>