Posts

DAX Deep Dive 11: A Snapshot That Halts the Filter Flow: The Decisive Moment a DAX VAR Becomes a 'Constant'

Image
When creating measures in Power BI, writing CALCULATE directly versus storing it inside a VAR appears to yield the same result on the surface. However, a massive divergence exists between the two regarding 'Evaluation Timing.' Today, this article explores the concept of 'Constantization' that occurs the exact moment a variable is assigned. 1. Example Data 1) Products ProductID ProductName Category UnitPrice P-001 MacBook Pro 16 Laptop 2500 P-002 iPad Pro 12.9 Tablet 1200 P-003 iPhone 15 Pro Mobile 1100 P-004 Airpods Max Audio 550 P-005 Studio Display Monitor 1600 P-006 Apple Watch Ultra Wearable 800 P-007 Mac Mini M2 Desktop ...

DAX Deep Dive 10: Why Your SUMX Total is Wrong – How CALCULATE Enables Context Transition

Image
Many people memorize the sentence, "CALCULATE transforms a row into a filter," yet they find themselves helpless when faced with errors in practice. The cause of this problem is not simple. The core issue is not merely that "transition occurs," but rather when and within what scope that transition is actually applied. To understand this mechanism most intuitively, we will introduce two concepts: The Eyes (Row Context): The gaze that reads through data line by line (Iterative functions). The Hands (Filter Context): The power to reconstruct the environment based on the information read (CALCULATE). Today, through three comparative scenarios—Measures A, B, and C—we will perfectly master how results change dramatically when only the 'Eyes' are open versus when the 'Hands' move together, and how to restore our Totals to nor...

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. ...