Posts

DAX Deep Dive 06 : 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...

Complete Guide to Power BI Dynamic Formatting: Practical Core Technologies for Making Numbers "Readable" (Dynamic Format Strings)

Image
In the professional world of Power BI, Dynamic Format Strings go beyond mere visual effects; they are a core technology that accelerates data interpretation. This is especially true when report users are executives who prefer intuitive units and symbols over complex, raw numbers. There are three primary core scenarios for dynamic formatting most frequently used in practice: ✔ Automatic Scaling based on Magnitude: Displaying 'Billion' for large values and 'Unit' for small values. ✔ Format Switching based on Selected KPI: Automatically changing formats (e.g., '$' for Sales and '%' for Growth Rate). ✔ Inserting Conditional Text and Symbols: Adding ▲/▼ symbols based on variance. In this article, we will focus on the setup methods and the automatic unit scaling among these three scenarios. 1. ...

DAX Deep Dive 06 : Power BI DAX Master Guide – Everything About SELECTEDMEASURE()

Image
1. What is SELECTEDMEASURE()? Simply put, it is a "placeholder" that refers to the "very measure currently being calculated." Normally, when writing DAX, you explicitly use the name of a measure, such as [Total Sales]. However, within Dynamic Format Strings or Calculation Groups, it is impossible to know in advance which measure will be used. In these cases, SELECTEDMEASURE() acts as a command that says, "Whichever measure comes in, fetch its value first!" • Usage: Dynamic Format Strings, Calculation Groups • Characteristics: Since you don’t need to hard-code measure names, the reusability of your code is maximized. 2. Why is SELECTEDMEASURE() a 'Revolution'? Suppose a company report has 50 different metrics, and you need to apply a rule to every single one of them: "If the value is 1 million or more, attach an 'M' unit; if it is 1,000 or more, attach a 'K' unit." ...