Posts

Showing posts with the label DAX

Mastering Filtered Calculations in Power BI: A Guide to Smarter DAX

Image
Filtered calculations are the secret sauce behind powerful, dynamic dashboards in Power BI. Whether you're analyzing sales by region, filtering by time periods, or comparing performance across categories, mastering DAX functions like CALCULATE, FILTER, and ALL is essential. What Are Filtered Calculations? In Power BI, filtered calculations allow you to compute values based on specific conditions or contexts. This is especially useful when you want to: Compare filtered vs. unfiltered totals Apply dynamic filters in visuals Override slicers or report filters The CALCULATE function is the cornerstone of this technique. Example 1: Total Sales by Region (No Filter) This chart shows total sales across all regions without any filters applied: Example 2: Total Sales by Region (Filtered for Q1) Now let’s apply a filter for Quarter 1 using DAX or a slicer: Resulting chart: Example 3: Using CALCULATE with ALL vs. FILTER This chart compares two DAX expressions: CALCULATE(SUM(Sales), ALL(Regio...