Posts

DAX Deep Dive 09: Why Your DAX Keeps Failing – An Anatomy of the CALCULATE Internal Execution Timeline

Image
In Power BI, the most powerful and simultaneously the most misunderstood function is undoubtedly CALCULATE . Many users operate under the following assumption: “Since it is inside CALCULATE, the SUM will be calculated first, and then the filter will be applied, right?” To put it bluntly, it is exactly the opposite. CALCULATE in DAX does not execute procedurally. In other words, it is not structured to execute "from top to bottom" like C or Python; rather, it is a method where filters are defined first → the environment is reconstructed → and then the expression is evaluated upon that foundation. Therefore, it is more accurate to understand CALCULATE not merely as a function, but as an "engine that redesigns the calculation environment." In this post, we will precisely organize the internal execution order (timeline) of CALCULATE based on actual example data. ...

DAX Deep Dive 08: The Decisive Difference Between ALL vs. VALUES Filter Design

Image
When using the FILTER function inside CALCULATE , deciding whether to set the stage with ALL or VALUES is a critical design choice. It determines whether you will "acknowledge the authority of external slicers or completely ignore them." By comparing the two codes side-by-side, let us analyze how the results of independent evaluations within the engine differ. 1. Example Data for Analysis: SalesData (Fact Table) This data contains 20 transactions that occurred during a single day. Date Time ID ProductName Category SalesAmount 2024-01-01 8:30 C01 Americano Beverage 45 2024-01-01 8:45 C02 Cafe Latte Beverage 8 2024-01-0...

DAX Deep Dive 07 : Why a Single VAR Changes the Result in DAX: The Difference Between Inside vs. Outside CALCULATE

Image
When working with Power BI, you will eventually encounter a moment where you ask: "It's clearly the same logic... so why are the results different?" Specifically, the experience of getting completely different results depending on whether you used a VAR or not is an almost essential rite of passage for practitioners. This issue is not a simple difference in syntax; it is deeply connected to the Evaluation Timing of the DAX engine. This article clarifies this difference and explains structurally why results vary inside and outside of CALCULATE. 1. The Essence of the Problem: "Same Code, Different Results" Let’s compare the following two codes. The goal is to calculate the 'Average of the last 4 months from the current point.' 1) Case 1: Direct Evaluation Inside CALCULATE (Normal Operation) This method works exactly as we intended, escaping the influence of the sl...

Complete Guide to Power BI Dynamic Formatting (Part 2) – How to Automatically Change Units Based on KPIs (ISINSCOPE + Dynamic Format String)

Image
In the previous post, we covered the basic concepts of Dynamic Format Strings in Power BI. In this installment, we take it a step further by introducing core patterns used directly in the field: • “Reports where units change automatically based on the indicator (KPI)” • “Advanced design that expresses both % and currency within a single column” In practice, I have seen many cases where reports become unnecessarily complex due to these requirements. Especially as the number of KPIs increases, “unit management” becomes increasingly tedious. This article summarizes how to solve this problem cleanly. ✔ When a KPI is selected → Automatic unit change ✔ In tables → Rows show %, Totals show currency ✔ With 1 column → Simultaneous expression of Weight + Total These are patterns you can apply immediately in...

Power BI Chart Tips : Field Parameters Master Guide - KPI Switching + Dynamic Formatting with Just One Chart

Image
When creating reports, we often face the same dilemma: "I want to see both Sales and Growth Rate—do I have to create two separate charts?" The feature that solves this inefficiency in one go is Field Parameters . In this article, we will cover everything from switching multiple KPIs in a single chart to applying dynamic formatting, all in a practical way you can use immediately. 1. What are Field Parameters? (Conceptual Understanding) When you utilize the Power BI Field Parameters feature in a chart, it allows the axis (X-axis) or values (Y-axis) to swap in real-time based on the selection a user makes in a slicer. • The Old Way: You had to create complex SWITCH function measures or overlap multiple charts using the 'Bookmark' feature. • The Current Way: Dynamic chart control is possible with just a few clicks, and maintenance is extremely easy. As a re...