← Back to Modules 🏠 Back to Home
Created by Gagan Sir

Power BI + DAX Complete Master Manual

Complete Comprehensive Reference covering all 13 PDF Sections & 18 Pages

Created by Gagan Sir
Module 01: Power BI Fundamentals, Architecture & Power Query Data Transformation
Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
1
Power BI Overview & Core Components
🇬🇧 English Definition
Power BI is Microsoft's enterprise Business Intelligence platform used for connecting to data sources, transforming raw data, creating relational data models, writing DAX calculations, and publishing interactive reporting dashboards.
🇮🇳 Hinglish Definition
Power BI raw data ko clean karke interactive charts, reports aur executive dashboards mein convert karta hai. Ye decision-making ko fast aur data-driven banata hai.
ComponentPurpose / KaamKey Capability
Power BI DesktopCreate reports & data modelsAuthoring environment for Windows
Power QueryClean and transform dataM-code engine for ETL data cleansing
Data ModelDefine table relationshipsStar schema / Snowflake relationships
DAXCreate business calculationsFormulas for measures and columns
Power BI ServicePublish and share reportsCloud collaboration portal
Gateway / RefreshData refresh automationConnects cloud reports to local databases
2
Power BI End-to-End Workflow Flowchart
🔄 Power BI End-to-End Workflow
Import Data
Excel / CSV / SQL
➔
Power Query
Clean + data types
➔
Data Model
Keys + relationships
➔
DAX Logic
Measures + columns
➔
Visuals & Service
Dashboard + publish
💡 Fundamental Rule
  • Power Query prepares data; DAX calculates; Visuals communicate results.
  • 3
    Power Query Data Cleaning Checklist
    Power Query FeatureWhen to Use / Kab Use KareinAction Required
    Change TypeCorrect date, number and text data typesEnsure dates are Date type, sales are Decimal/Fixed Number
    Remove DuplicatesOnly if duplicate rows are unwantedRemove duplicate transaction IDs
    Replace ValuesFix inconsistent labels or spelling mistakesReplace "N/A" with 0 or fix "Lptop" to "Laptop"
    Split ColumnSplit full name or address into separate fieldsSplit "First Last" by delimiter space
    Merge QueriesJoin tables using a common keyEquivalent to SQL JOIN between Fact and Dimension
    Append QueriesCombine rows from similar structured tablesEquivalent to SQL UNION ALL across monthly files
    Remove ErrorsOnly if removing error rows is appropriateClean bad rows prior to model loading
    Created by Gagan Sir
    Module 02: Sample Dataset, Data Import & Column vs Measure vs Table
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    4
    Practice Sales Dataset / Abhyas Data
    OrderIDDateProductCityQtySalesCost
    10101-Jan-2026LaptopMohali210000080000
    10203-Jan-2026MouseChandigarh525001500
    10305-Jan-2026KeyboardLudhiana345002700
    10410-Feb-2026LaptopChandigarh15000040000
    10515-Feb-2026MonitorMohali23000024000
    10620-Mar-2026MouseRopar1050003000
    10705-Mar-2026LaptopLudhiana15000040000
    10812-Mar-2026MonitorChandigarh34500036000
    5
    Expected Totals & Data Import Steps
    MetricResult ValueFormula / Logic
    Total Sales₹2,87,000SUM(Sales[Sales])
    Total Cost₹2,27,200SUM(Sales[Cost])
    Total Profit₹59,800Total Sales - Total Cost (₹2,87,000 - ₹2,27,200)
    Rows / Orders88 unique transaction rows
    Unique Products / Cities4 / 4DISTINCTCOUNT of Product and City
    🔄 Data Import Steps Flowchart
    Open Power BI
    Desktop App
    ➔
    Get Data
    Excel Workbook
    ➔
    Navigator
    Select Sales Sheet
    ➔
    Transform Data
    Power Query
    ➔
    Close & Apply
    Load to Model
    6
    Calculated Column vs Measure vs Calculated Table
    // 1. Calculated Column (Row-Level Stored Value) Profit = Sales[Sales] - Sales[Cost] // Row 1 Example: ₹100,000 - ₹80,000 = ₹20,000 // 2. Measures (Interactive Aggregations recalculated in Filter Context) Total Sales = SUM(Sales[Sales]) Total Cost = SUM(Sales[Cost]) Total Profit = [Total Sales] - [Total Cost] Total Orders = DISTINCTCOUNT(Sales[OrderID]) // 3. Calculated Table (New Table Structure in Data Model) ProductList = DISTINCT(Sales[Product])
    FeatureCalculated ColumnMeasureCalculated Table
    OutputPer-row value stored in RAMDynamic calculation resultNew standalone table
    Best ForRow-level filtering & slicersKPIs, totals, card visualsDate tables, helper dimensions
    Filter BehaviorStored static valuesRecalculates on slicer changesDepends on model relationships
    🎯 Golden Rule of DAX Modeling
    Use columns for row-level classification and slicing; use measures for interactive aggregations and KPIs; use calculated tables for structural data models.
    Created by Gagan Sir
    Module 03: DAX Symbols, Operators & Functions Reference
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    7
    DAX Symbols and Operators Reference Table
    SymbolMeaning / PurposeExample Usage
    + / -Addition / subtraction10 + 5; 10 - 5
    * / / / ^Multiply / divide / power exponent10 * 5; 2 ^ 3
    =Assignment or equality comparisonTotal Sales = SUM(...)
    ==Strict equality comparison (BLANK != 0)BLANK() == 0 is FALSE
    <>Not equal toSales[City] <> "Ropar"
    > / <Greater than / less thanSales[Sales] > 10000
    >= / <=Greater or equal / less or equalSales[Quantity] >= 2
    &&Logical AND (Both true)Condition1 && Condition2
    ||Logical OR (At least one true)Condition1 || Condition2
    &Concatenate text strings"City: " & Sales[City]
    [Measure]Measure reference syntax[Total Sales]
    Table[Column]Column reference syntaxSales[Cost]
    ()Grouping argumentsSUM(Sales[Sales])
    {}Table constructor{1, 2, 3}
    VAR / RETURNDefine local variable / return outputVAR X = [Total Sales] RETURN X
    8
    Important Distinction: Column vs Measure Syntax & Logic
    🇬🇧 English Distinction
    `Sales[Sales]` refers to a specific column in the Sales table, whereas `[Total Sales]` refers to a measure. In DAX, `=` treats BLANK as zero, while `==` strictly checks equality.
    🇮🇳 Hinglish Distinction
    `Sales[Sales]` column reference hai aur `[Total Sales]` measure reference hai. DAX mein `=` BLANK ko 0 maanta hai jabki `==` strict check karta hai.
    // Conditional Column Example Sales Status = IF(Sales[Sales] >= 50000, "High", "Low") // Compound Logical Expressions Premium Order = IF(Sales[Sales] > 10000 && Sales[Quantity] >= 2, "Premium", "Regular") Target City = IF(Sales[City] IN {"Mohali", "Ropar"}, "Target", "Other") Order Label = "Order ID: " & Sales[OrderID]
    9
    DAX Function Reference Table
    FunctionPurpose / KaamExample Formula
    SUMAdd numeric values in a columnSUM(Sales[Sales])
    AVERAGECalculate average valueAVERAGE(Sales[Sales])
    MIN / MAXFind minimum / maximum valueMAX(Sales[Sales])
    COUNTCount nonblank numeric valuesCOUNT(Sales[OrderID])
    COUNTACount nonblank values (text + numbers)COUNTA(Sales[Product])
    COUNTROWSCount total rows in a tableCOUNTROWS(Sales)
    DISTINCTCOUNTCount distinct unique valuesDISTINCTCOUNT(Sales[City])
    IFConditional logical checkIF(test, true, false)
    SWITCHMultiple condition branch evaluationSWITCH(TRUE(), test1, res1, default)
    ISBLANKCheck if value is blank/nullISBLANK([Total Sales])
    COALESCEReturn first non-blank valueCOALESCE([Total Sales], 0)
    DIVIDESafe division handling divide-by-zeroDIVIDE([Total Profit], [Total Sales], 0)
    ROUND / ABSRound decimal / absolute valueROUND(12.345, 2); ABS(-10)
    LEFT/RIGHT/MIDExtract text charactersLEFT(Sales[Product], 3)
    FORMATFormat value as text stringFORMAT([Total Sales], "0,0")
    YEAR/MONTH/DAYExtract date partsYEAR(Sales[Date])
    // Conditional DAX Formulas Sales Band = SWITCH(TRUE(), Sales[Sales] >= 50000, "High", Sales[Sales] >= 10000, "Medium", "Low") Sales Check = IF(ISBLANK(Sales[Sales]), "Missing", "Available") Profit Margin % = DIVIDE([Total Profit], [Total Sales], 0)
    ⚠️ Percentage Formatting Rule
  • When using Power BI Percentage formatting tool on a Measure, DO NOT multiply by 100 inside the DAX formula! `DIVIDE([Total Profit], [Total Sales], 0)` automatically formats to 20.84%.
  • Created by Gagan Sir
    Module 04: Iterator Functions (SUMX, AVERAGEX, RANKX) & Row-by-Row Execution
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    10
    Iterator Functions Concept & Execution Model
    🇬🇧 English Definition
    Iterator functions ending in 'X' (such as SUMX, AVERAGEX, RANKX) iterate row-by-row through a table, evaluate an expression for each row, and then aggregate the results.
    🇮🇳 Hinglish Definition
    Iterator functions har row par jaakar calculation karte hain aur baad mein un sabhi row-level results ko sum, average ya rank karte hain.
    Total Profit X = SUMX(Sales, Sales[Sales] - Sales[Cost])
    🔄 SUMX Row-by-Row Execution Flowchart
    Take Row 1
    OrderID 101
    ➔
    Calculate Expression
    100000 - 80000 = 20000
    ➔
    Repeat All Rows
    Rows 1 to 8
    ➔
    Sum Results
    Total Profit = ₹59,800
    11
    Iterator Functions Reference Table & SUM vs SUMX
    FunctionUse / KaamSyntax Example
    SUMXSum evaluated row expressionSUMX(Sales, Sales[Sales] - Sales[Cost])
    AVERAGEXAverage evaluated row expressionAVERAGEX(Sales, Sales[Sales] - Sales[Cost])
    COUNTXCount nonblank numeric expression resultsCOUNTX(Sales, Sales[Sales] - Sales[Cost])
    RANKXRank items by expressionRANKX(ALL(Sales[Product]), [Total Sales],, DESC, DENSE)
    🎯 SUM vs SUMX Interview Difference
    SUM: Operates on a single numeric column directly (`SUM(Sales[Sales])`).
    SUMX: Accepts a table and an expression, evaluates the expression row-by-row, and sums the results (`SUMX(Sales, Sales[Sales] - Sales[Cost])`).
    12
    RANKX Deep Dive & Ties Handling
    Product Rank = RANKX(ALL(Sales[Product]), [Total Sales],, DESC, DENSE)
    🔍 RANKX Parameter Breakdown
    • `ALL(Sales[Product])`: Table argument clearing product filters to rank all products against each other.
    • `[Total Sales]`: Expression used to order rankings.
    • `DESC`: Highest sales value receives Rank 1.
    • `DENSE`: Handles ties without skipping rank numbers (e.g. 1, 2, 2, 3 instead of 1, 2, 2, 4).
    Created by Gagan Sir
    Module 05: CALCULATE, FILTER, Context Transition & Variables
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    13
    CALCULATE and FILTER Mechanics
    🇬🇧 English Definition
    CALCULATE is the most powerful function in DAX. It evaluates an expression in a modified filter context. FILTER returns a table of matching rows and is passed into CALCULATE for complex filters.
    🇮🇳 Hinglish Definition
    CALCULATE existing filter context ko change ya override karke formula calculate karta hai. FILTER function condition matching rows ki table return karta hai.
    // CALCULATE Simple Filter Modification Mohali Sales = CALCULATE([Total Sales], Sales[City] = "Mohali") // Expected Output: ₹1,30,000 // CALCULATE with FILTER Function High Value Sales = CALCULATE([Total Sales], FILTER(Sales, Sales[Sales] > 10000))
    14
    Filter Modifiers & Sales Share %
    FunctionPurpose / Kaam
    CALCULATEEvaluate expression in modified filter context
    FILTERReturn table matching logical condition
    ALLClear all filters from table or column
    REMOVEFILTERSExplicitly clear filters from specified table/column
    ALLEXCEPTClear all filters except specified columns
    KEEPFILTERSIntersect new filter with existing filter context
    ALLSELECTEDRespect visual slicers while ignoring row grouping filters
    // Sales Share % (City Contribution to Total Sales) Sales Share % = DIVIDE([Total Sales], CALCULATE([Total Sales], REMOVEFILTERS(Sales[City])), 0)
    🔍 REMOVEFILTERS Behavior
  • `REMOVEFILTERS(Sales[City])` clears the City filter to compute total company sales while preserving Date or Product slicer selections!
  • 15
    Row Context vs Filter Context vs Context Transition
    ConceptExampleExplanation
    Row contextProfit = Sales[Sales] - Sales[Cost]Knows current row values automatically during iteration
    Filter contextTotal Sales = SUM(Sales[Sales])Active slicers, report filters, and visual rows filtering data
    Context transitionCALCULATE() inside row contextConverts current row context into equivalent filter context
    City Filter Context Breakdown Table
    Selection / CityTotal Sales Output
    No city filter (Overall)₹2,87,000
    Mohali₹1,30,000
    Chandigarh₹97,500
    Ludhiana₹54,500
    Ropar₹5,000
    16
    VAR and RETURN & Virtual Tables
    // Variables for readability & performance Profit Margin % = VAR Revenue = [Total Sales] VAR ProfitValue = [Total Profit] RETURN DIVIDE(ProfitValue, Revenue, 0)
    Virtual Table FunctionPurpose / Kaam
    VALUES / DISTINCTReturn distinct single-column table
    ADDCOLUMNSAdd calculated columns to a table expression
    SUMMARIZECreate a grouped summary table (like SQL GROUP BY)
    SELECTCOLUMNSReturn selected or renamed columns
    TOPNReturn top N rows based on expression
    CROSSJOINCreate Cartesian product combinations between tables
    UNION / INTERSECT / EXCEPTCombine or compare table rows
    Product Summary = SUMMARIZE(Sales, Sales[Product], "Product Sales", SUM(Sales[Sales]))
    Created by Gagan Sir
    Module 06: Date Intelligence, Time Analysis & Calendar Tables
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    17
    Calendar Table Setup & Best Practices
    🇬🇧 English Definition
    Time Intelligence in DAX requires a dedicated continuous Date table marked as Date Table in Power BI, connected via a 1-to-Many relationship to the Fact table Date column.
    🇮🇳 Hinglish Definition
    Time intelligence formulas (MTD, YTD, YoY) ke sahi kaam karne ke liye ek alag Date table banana aur use 'Mark as Date Table' set karna zaroori hai.
    // 1. Create Date Table DateTable = CALENDAR(MIN(Sales[Date]), MAX(Sales[Date])) // 2. Add Calculated Columns for Sorting & Slicing Year = YEAR(DateTable[Date]) Month Number = MONTH(DateTable[Date]) Month Name = FORMAT(DateTable[Date], "MMM")
    ⚠️ Month Name Sorting Rule
  • Always select 'Month Name' column and click 'Sort by Column' ➔ 'Month Number'. This prevents alphabetical sorting (Apr, Aug, Dec) and enforces calendar sequence (Jan, Feb, Mar)!
  • 18
    Time Intelligence Functions & Growth Formulas
    Measure / FunctionSyntax ExampleMeaning / Purpose
    MTDTOTALMTD([Total Sales], DateTable[Date])Month-to-date cumulative sales
    YTDTOTALYTD([Total Sales], DateTable[Date])Year-to-date cumulative sales
    Previous MonthCALCULATE([Total Sales], PREVIOUSMONTH(DateTable[Date]))Sales from previous month
    Previous YearCALCULATE([Total Sales], SAMEPERIODLASTYEAR(DateTable[Date]))Sales from same period last year
    Growth[Total Sales] - [Previous Month Sales]Absolute monetary sales growth
    Growth %DIVIDE([Sales Growth], [Previous Month Sales], 0)Relative percentage sales growth
    Sales MTD = TOTALMTD([Total Sales], DateTable[Date]) Sales YTD = TOTALYTD([Total Sales], DateTable[Date]) Previous Month Sales = CALCULATE([Total Sales], PREVIOUSMONTH(DateTable[Date])) Sales Growth = [Total Sales] - [Previous Month Sales] Sales Growth % = DIVIDE([Sales Growth], [Previous Month Sales], 0)
    Created by Gagan Sir
    Module 07: Advanced Business Measures, Visual Selection & Dashboard Guide
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    19
    Advanced Business Measures
    // 1. Product Contribution Percentage Product Sales % = DIVIDE([Total Sales], CALCULATE([Total Sales], REMOVEFILTERS(Sales[Product])), 0) // 2. Top Products Ranking Product Rank = RANKX(ALL(Sales[Product]), [Total Sales],, DESC, DENSE) // 3. Target Achievement Total Target = SUM(SalesTarget[TargetAmount]) Target Achievement % = DIVIDE([Total Sales], [Total Target], 0) Target Status = IF([Total Sales] >= [Total Target], "Target Achieved", "Below Target") // 4. Running Total / Cumulative Sales Running Total = CALCULATE(SUM(Sales[Sales]), FILTER(ALLSELECTED(DateTable[Date]), DateTable[Date] <= MAX(DateTable[Date]))) // 5. Dynamic Chart Title Sales Chart Title = "Sales Performance - " & SELECTEDVALUE(Sales[City], "All Cities")
    20
    Power BI Visualizations Pane & Visual Selection Guide (Icons & Symbols)
    🇬🇧 Visual Selection Rule
    Power BI provides a distinct visual icon in the Visualizations Pane for each chart type. Select Clustered Bars for comparisons, Line charts for trends over time, Donut/Pie for composition (<= 5 categories), Scatter for correlation, and Gauges/KPI Cards for metric targets.
    🇮🇳 Hinglish Explanation
    Power BI Desktop Visualizations Pane mein har visual chart ka specific symbol hota hai. Sahi visual icon select karna report clarity, dashboard presentation aur interview explanation ke liye zaroori hai.
    Icon / Symbol Visual Type Best Use / Kab Use Karein Typical Fields
    📊 Clustered bar/column Compare categories side-by-side Product + Sales
    📶 Stacked bar/column Total & category breakdown Region + Category + Sales
    💯 100% stacked bar Percentage composition comparison Month + Category + Sales
    📈 Line chart Trend over time Date + Sales
    ⛰️ Area chart Magnitude volume over time Date + Sales
    📊📈 Combo chart Sales with target overlay Month + Sales + Target
    🪜 Waterfall chart Increase/decrease bridge analysis Revenue, costs, profit
    🔻 Funnel chart Process stages conversion Stage + count
    🔵 Scatter plot Relationship between 2 variables Sales + Profit
    🍩 Pie / Donut chart Share of few categories (<= 5) Category + Sales
    🧱 Treemap Contribution by nested rectangles Product + Sales
    🗺️ Map / Azure Maps Geographic spatial analysis City/State or Lat/Long
    ⏱️ Gauge / KPI Target achievement metrics Actual vs Target
    ▦ Table / Matrix Detailed row data / Pivot summary OrderID, Category, Sales
    🌳 Decomposition Tree Root cause driver exploration Sales + Dimensions
    🎴 Card / Multi-row card Single KPI or metric list summary Total Sales / Revenue
    🎛️ Slicer Interactive data filtering control Year, Region, Category
    21
    Dashboard Building 8-Step Flowchart & Core KPIs
    🔄 Dashboard Creation Process Flowchart
    1. Import & Clean
    Power Query
    ➔
    2. Model Keys
    Relationships
    ➔
    3. Core Measures
    DAX KPIs
    ➔
    4. KPI Cards
    Top metrics
    ➔
    5. Slicers & Charts
    Bar/Line/Donut
    ➔
    6. Publish
    Service Report
    Created by Gagan Sir
    Module 08: Debugging, Assignments, Glossary & 50+ Interview Q&A Bank
    Power BI Desktop + Power Query + Data Modeling + DAX Formulas + Time Intelligence + Visual Selection + 50+ Interview Q&A
    22
    Common DAX Errors & Troubleshooting Table
    Problem / ErrorPossible CauseFix / Solution
    Single value cannot be determinedPassing a column to measure without aggregationWrap column in SUM(), MAX(), or SELECTEDVALUE()
    Incorrect totals in visualMeasure ignoring table grain or filter contextUse SUMX() or adjust CALCULATE filter modifiers
    Blank resultDate table disconnect or missing filter matchCheck relationships & date table coverage
    Divide by zero errorStandard division `/` by 0Use `DIVIDE(num, denom, 0)`
    Month names out of orderAlphabetical sorting defaultSort Month Name column by Month Number
    Percentage 100x too highMultiplied formula by 100 while applying % formatRemove `* 100` from formula
    Previous year blankMissing prior year dates in Date tableExpand CALENDAR date range
    Circular dependencyCalculated columns referencing each otherRefactor to measures or review model design
    23
    12 Practice Assignments with Hints & Formulas
    No.Task / AssignmentHint / Formula
    1Total salesSUM(Sales[Sales])
    2Total costSUM(Sales[Cost])
    3Total profit[Total Sales] - [Total Cost]
    4Profit marginDIVIDE([Total Profit], [Total Sales], 0)
    5Label sales >= 50000 as HighIF(Sales[Sales] >= 50000, "High", "Low")
    6Mohali salesCALCULATE([Total Sales], Sales[City] = "Mohali")
    7Unique cities countDISTINCTCOUNT(Sales[City])
    8Count total rowsCOUNTROWS(Sales)
    9Sum sales > 10000 rowsCALCULATE([Total Sales], FILTER(Sales, Sales[Sales] > 10000))
    10Top 5 productsRANKX or visual Top N filter
    11Previous month salesPREVIOUSMONTH + CALCULATE
    12Running totalCALCULATE + FILTER + ALLSELECTED
    24
    50+ Power BI & DAX Master Interview Q&A
    ❓ Core Concept Interview Q&A
  • Q: What is the difference between Power Query and DAX? Power Query is an ETL tool used for data cleaning and transformation before loading into the model; DAX is a calculation engine used for dynamic reporting, measures, and business analytics.
  • Q: Difference between Calculated Column and Measure? A column calculates values row-by-row at refresh time and stores them in RAM; a measure calculates on-the-fly inside the active visual filter context.
  • Q: How does CALCULATE work? `CALCULATE` evaluates an expression in a modified filter context by adding, removing, or updating active table filters.
  • Q: What is Context Transition? Context Transition occurs when `CALCULATE()` is invoked inside a row context (like SUMX or a Calculated Column), converting the current row into an equivalent filter context.