PowerLens
All posts
Power BIFebruary 12, 2026· 4 min read

Power Query Tricks That Will Transform Your Power BI Workflow

J

Juan Carlos Santiago

Power Query Tricks That Will Transform Your Power BI Workflow

Power Query Tricks That Will Transform Your Power BI Workflow

Power Query is the unsung hero of Power BI projects. While many analysts focus on DAX calculations and visualizations, the real magic happens in the data transformation layer. Over years of working with enterprise datasets, I've discovered that mastering Power Query can cut your development time in half and dramatically improve model performance.

Let me share the techniques that have proven invaluable in my projects.

Merging Queries: Combining Data Like a Pro

Merging queries is one of the most practical operations you'll perform. Unlike simple lookups in Excel, Power Query merges happen at the transformation stage, creating cleaner models.

When to merge:

  • Joining fact tables with dimension tables
  • Combining customer data with transaction history
  • Appending regional information to sales data

The process:

  1. Load both queries into Power Query
  2. Select your primary query
  3. Go to Home tab → Merge Queries
  4. Choose your join type (Left Outer, Right Outer, Full Outer, or Inner)
  5. Select the matching columns from both tables
Example: Merging Sales data with Product dimensions
- Sales table has: OrderID, ProductID, Quantity
- Product table has: ProductID, ProductName, Category
- Result: Sales with product details included

Pro tip: Always use the most granular table as your primary query to avoid losing data rows.

Unpivoting Columns: From Wide to Tall Data

Monthly data often arrives in wide format—January, February, March as separate columns. Power BI typically requires tall format for proper filtering and analysis.

Wide Format:
Region    | Jan | Feb | Mar
North     | 100 | 120 | 140
South     | 80  | 95  | 110

Tall Format (after unpivoting):
Region | Month | Sales
North  | Jan   | 100
North  | Feb   | 120
North  | Mar   | 140

How to unpivot:

  1. Select the columns you want to unpivot (January, February, March)
  2. Right-click → Unpivot Columns
  3. Power Query creates two new columns: Attribute (month names) and Value (sales figures)
  4. Rename columns appropriately

This single operation eliminates the need for complex DAX measures and enables straightforward month-over-month comparisons.

Custom Columns with M Language

Sometimes built-in transformations don't cut it. This is where M language shines. You don't need to be an M expert—understanding basic syntax handles 90% of scenarios.

Common custom column examples:

// Extract month name from date
= Date.MonthName([DateColumn])

// Concatenate multiple columns
= [FirstName] & " " & [LastName]

// Simple if-then logic
= if [Sales] > 1000 then "High" else "Low"

// Nested conditions
= if [Amount] > 5000 then "Premium"
  else if [Amount] > 1000 then "Standard"
  else "Basic"

Creating a custom column:

  1. Home tab → Custom Column
  2. Enter your M expression
  3. Name it appropriately
  4. Click OK

This approach keeps transformations in Power Query rather than cluttering your model with DAX measures.

Handling Errors in Columns

Real-world data is messy. Blank cells, type mismatches, and invalid values break your transforms. Power Query's error handling prevents your refresh from failing.

// Try-catch approach
= try Number.FromText([Value]) otherwise null

// Using if.error (legacy)
= if [Value] = "" then 0 else Number.FromText([Value])

Practical approach:

  1. Identify columns with potential errors
  2. Add custom columns using try-otherwise
  3. This converts errors to null, allowing your query to complete
  4. In Power BI, you can filter or replace nulls as needed

This technique is crucial for automated refreshes that run unattended.

Creating Robust Date Tables

A proper date dimension is fundamental to time-based analysis. While you could use DAX, Power Query is more efficient.

let
  StartDate = #date(2023,1,1),
  EndDate = #date(2024,12,31),
  DateList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1,0,0,0)),
  Table = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),
  AddYear = Table.AddColumn(Table, "Year", each Date.Year([Date])),
  AddMonth = Table.AddColumn(AddYear, "Month", each Date.Month([Date])),
  AddDay = Table.AddColumn(AddMonth, "Day", each Date.Day([Date]))
in
  AddDay

This generates a complete date table with year, month, and day values—ready for your model relationships.

Incremental Refresh Basics

Large datasets create refresh bottlenecks. Incremental refresh only pulls new and modified data.

Setup requirements:

  1. Add a date column to track when records were created or modified
  2. Enable incremental refresh in Power BI Premium
  3. Define parameters for RangeStart and RangeEnd
  4. Filter your query: [ModifiedDate] > RangeStart and [ModifiedDate] <= RangeEnd

Benefits:

  • 80-90% faster refreshes
  • Lower system load
  • Practical for datasets exceeding 1GB

Pro Tip

Always create a "Staging" folder in Power Query for intermediate queries that feed your final tables. This modular approach makes debugging easier and improves reusability. Document your M code with comments—future you will appreciate it when maintaining the model six months later.

#power-bi#power-query#data-transformation#m-language#performance