<?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 Talha Naeem Rao on Medium]]></title>
        <description><![CDATA[Stories by Talha Naeem Rao on Medium]]></description>
        <link>https://medium.com/@talhanaimrao?source=rss-109369ad1b9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UaEd5M8PxSQRUsoVsmB9ug@2x.jpeg</url>
            <title>Stories by Talha Naeem Rao on Medium</title>
            <link>https://medium.com/@talhanaimrao?source=rss-109369ad1b9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 16:40:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@talhanaimrao/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[Understanding FILTER CONTEXT and ROW CONTEXT in Power BI]]></title>
            <link>https://medium.com/@talhanaimrao/understanding-filter-context-and-row-context-in-power-bi-39d616ce0327?source=rss-109369ad1b9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39d616ce0327</guid>
            <dc:creator><![CDATA[Talha Naeem Rao]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 18:50:09 GMT</pubDate>
            <atom:updated>2023-08-21T18:51:06.703Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5NZAIabb4tl8oF3XmKrDQ.jpeg" /><figcaption>A dashboard designed by me for entry into online dashboard design competition.</figcaption></figure><p>Are you new to Power BI and finding the concepts of “FILTER CONTEXT” and “ROW CONTEXT” a bit perplexing? Don’t worry, you’re not alone! These terms might sound complicated, but with a little explanation and a few examples, you’ll have a solid grasp of these concepts.</p><p><strong>Filter Context: What’s Going On?</strong></p><p>Think of the “FILTER CONTEXT” as a set of conditions that determine which data is currently in focus. When you create visuals or measures in Power BI, you often want to consider a subset of your data. This subset is defined by filters applied to your data. These filters could come from slicers, visual interactions, or even direct filters on the visuals.</p><p>For example, imagine you have a sales dataset with information about products, regions, and sales amounts. If you add a slicer to filter by region, the “FILTER CONTEXT” will change based on the region you select. It’s like looking at your data through a specific lens.</p><p><strong>Row Context: Getting Up Close and Personal</strong></p><p>On the other hand, “ROW CONTEXT” is all about focusing on a single row of data while performing calculations. When Power BI evaluates a measure or a calculation, it often goes through each row of your data to provide results. In this context, Power BI temporarily treats each row as if it’s the only row in the dataset.</p><p>Let’s say you want to calculate the total sales for each product. Power BI would go through each row of your data, considering only the data in that row while doing the calculations. It’s as if the rest of the dataset doesn’t exist in that moment.</p><p><strong>Putting It All Together: An Example</strong></p><p>Imagine you have a table with sales data for different products, regions, and sales amounts. You want to create a measure that calculates the average sales per product in the selected region. Here’s how FILTER CONTEXT and ROW CONTEXT come into play:</p><p><strong>1. FILTER CONTEXT: </strong><br>If you’ve filtered the report to show only the “North” region, the FILTER CONTEXT now revolves around that region. Any calculation you perform will take into account only the data related to the “North” region.</p><p><strong>2. ROW CONTEXT:</strong><br> When you’re calculating the average sales per product, you focus on one product at a time. In this moment, ROW CONTEXT treats each product as if it’s the only one being considered. The calculation will use only the sales amounts for that product in the “North” region.</p><p>By understanding these contexts, you can build more accurate and meaningful visuals and measures in Power BI. Just remember:</p><p><strong>- FILTER CONTEXT</strong> is about the subset of data you’re looking at, influenced by filters and slicers.<br><strong>- ROW CONTEXT</strong> focuses on one row at a time, as if the rest of the data doesn’t exist during calculations.</p><p><strong>Real-Life Application: Filtering and Aggregating Data</strong></p><p>To truly grasp the power of FILTER CONTEXT and ROW CONTEXT, let’s dive into a real-life scenario: a sales dashboard for a retail company. Imagine you’re tasked with creating a dashboard that shows the total sales for each product category and the average sales per product within that category. Let’s break down how these concepts come into play:</p><p><strong>1. FILTER CONTEXT in Action:</strong><br> You start by adding a slicer to allow users to select a specific year. When a user chooses a year, the FILTER CONTEXT changes, focusing the entire report on data for that particular year. Now, any visual or measure you create will be influenced by this year filter. If the user selects “2022,” the FILTER CONTEXT revolves around that year, affecting all calculations and visuals.</p><p><strong>2. ROW CONTEXT at Work:</strong><br> As you create a measure to calculate the average sales per product within each category, you enter the world of ROW CONTEXT. Power BI evaluates each row, treating it as a standalone entity during calculations. For instance, if you’re calculating the average sales for a specific product within the “Electronics” category, ROW CONTEXT considers only the sales data for that product in the selected year. It’s like temporarily isolating the row and focusing solely on its data.</p><p><strong>Advanced Filtering Scenarios:</strong></p><p>Things get even more interesting when you start dealing with multiple filters. Imagine you have slicers for both the year and the region. The FILTER CONTEXT adapts to these two filters simultaneously. If a user selects “2022” and “North,” the FILTER CONTEXT narrows down the data to match both criteria. Similarly, ROW CONTEXT considers each row in relation to both the selected year and the chosen region when performing calculations.</p><p><strong>Avoiding Context Confusion:</strong></p><p>While FILTER and ROW CONTEXT are incredibly powerful, they can sometimes lead to unexpected results if not handled carefully. For instance, if you’re creating a calculated column, be mindful of how FILTER and ROW CONTEXT interact. A calculated column operates under a different set of rules compared to measures.</p><p><strong>Remember the Distinction:</strong></p><p>- FILTER CONTEXT defines the scope of data you’re analyzing, influenced by filters and slicers.<br>- ROW CONTEXT hones in on individual rows during calculations, treating them as isolated entities.</p><p>By understanding these distinctions, you can confidently navigate more complex scenarios and create insightful reports that cater to your users’ needs.</p><p>As you continue your journey into the world of Power BI, the concepts of FILTER CONTEXT and ROW CONTEXT will become second nature. With each report you build, you’ll harness the power of these contexts to provide meaningful insights that drive informed decisions. Keep exploring, keep learning, and keep turning your data into action!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d616ce0327" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey into the World of DAX:]]></title>
            <link>https://medium.com/@talhanaimrao/my-journey-into-the-world-of-dax-9c42984cd92f?source=rss-109369ad1b9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c42984cd92f</guid>
            <category><![CDATA[microsoft-power-bi]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[dax]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Talha Naeem Rao]]></dc:creator>
            <pubDate>Tue, 15 Aug 2023 13:32:25 GMT</pubDate>
            <atom:updated>2023-08-15T13:32:25.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unraveling CALCULATE, SUMX, AVERAGEX AND VALUE ()</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJfjK5tmNeNVvvPODa36VQ.png" /></figure><p>Hey fellow data enthusiasts! 👋 I’m on a thrilling journey into the world of DAX functions, and I can’t wait to share what I’ve learned so far. If you’re like me — a newbie data analyst eager to unravel the mysteries of CALCULATE, SUMX, and AVERAGEX — stick around for a novice-friendly guide filled with examples and even a bonus function: VALUE().</p><p><strong>1. The CALCULATE Enigma:</strong></p><p>Okay, imagine this: I’m knee-deep in sales data and want to find the total sales for a specific region. But wait, I need to consider product filters and date ranges too! Enter the CALCULATE function. It’s like a data magician that can tweak the rules.</p><p>So, I discovered that you can bend the rules with CALCULATE. In simple terms, it’s like telling your computer, “Hey, I want to SUM up the sales amounts, but only when the region is ‘North,’ the product is ‘Widget,’ and the date is on or after January 1, 2023.”</p><pre><br>Total Sales = CALCULATE(<br>                   SUM(Sales[Amount]),<br>                   Sales[Region] = “North”,<br>                   Sales[Product] = “Widget”,<br>                   Sales[Date] &gt;= DATE(2023, 1, 1)<br>                  )</pre><p><strong>2. SUMX vs. SUM: My Grand Dilemma:</strong></p><p>Okay, so I thought I had the hang of SUM — it just adds stuff up, right? But then I encountered a curveball: what if I need to add up stuff from different tables? Panic mode on!</p><p>Enter SUMX, the hero of this tale. It’s like SUM, but it can navigate through different tables, doing its math wizardry. Let’s say we have a ‘Sales’ table and a ‘Products’ table. I wanted to figure out the total revenue for each product, considering the price and quantity. SUMX to the rescue!</p><pre><br>Total Revenue = SUMX(<br>                   Products,<br>                   Products[Price] * RELATED(Sales[Quantity])<br>                  )</pre><p><strong>3. The AVERAGEX Chronicles: Averages Like Never Before:</strong></p><p>Averages sound simple, right? But what if I wanted to average some tricky calculated expressions? AVERAGEX to the rescue again! Imagine finding the average revenue per order for each customer. Our ‘Customers’ table and an ‘Orders’ table are like puzzle pieces, and AVERAGEX is our puzzle solver.</p><pre><br>Average Revenue per Order = AVERAGEX(<br>                                 Customers,<br>                                 DIVIDE(<br>                                 SUMX(RELATED(Orders), Orders[Revenue]),<br>                                 COUNTROWS(RELATED(Orders))<br>                                 )<br>                                )<br></pre><p><strong>A Little Surprise: The VALUE() Function:</strong></p><p>Hold on, there’s a bonus! Imagine I’m dealing with data stored as text, and I want to turn it into numbers for calculations. Hello, VALUE() function! It’s like my data’s translator. For example, if I had text representing numbers in my ‘Data’ column:</p><pre><br>Converted Data = VALUE(Data[TextColumn])<br></pre><p>As I keep diving into this data ocean, one thing’s for sure — DAX functions are my trusty companions. They’re like tools in my data toolbox, helping me craft insights and stories from raw numbers. So, fellow adventurers, let’s continue this journey together. And remember, even if you’re a novice like me, you’ve got the power of DAX functions on your side! 🚀📊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c42984cd92f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>