Excelgoodies logo +44 (0)20 3769 3689

Should Data Transformation Be Done in SQL or Power BI?


This question usually comes up after something starts hurting.

  • Refresh times increase
  • Numbers become hard to trace
  • Small changes take longer than expected

And then someone asks:
“Should this transformation be in SQL or in Power BI?”

By the time the question is asked, the answer is rarely obvious — because logic is already spread across multiple places.

After reviewing many Power BI projects backed by SQL, one pattern is consistent:
data transformation decisions made early tend to define how painful the project becomes later.

This article looks at where data transformation actually works best — based on real reporting scenarios, not tool capability lists.

Why This Question Keeps Causing Confusion

On the surface, both SQL and Power BI can:

  • Filter data
  • Create calculated columns
  • Clean and reshape datasets

So teams assume the choice doesn’t matter much.

In reality, it matters a lot — because SQL and Power BI serve different roles in the reporting lifecycle. Most long-term issues arise not because a transformation was wrong, but because it was done in the wrong layer.

A Real-World Pattern Seen Repeatedly

A familiar project story:

  • Initial dataset is small
  • Transformations are done quickly in Power BI
  • Reports go live successfully

Months later:

  • Data volume grows
  • More reports reuse the same data
  • Performance drops
  • Logic is duplicated across datasets

At that point, teams realise transformations placed for speed of delivery are now slowing everything down.

What Data Transformation Works Best in SQL

SQL is strongest when transformations are:

  • Foundational
  • Stable
  • Shared across reports

In real projects, SQL works best for:

Structural Transformations
 

  • Normalising raw tables
  • Separating facts and dimensions
  • Defining consistent keys

Data Quality Rules
 

  • Removing invalid records
  • Handling cancelled or reversed transactions
  • Applying standard business filters

Heavy or Repetitive Transformations
 

  • Large joins
  • Complex CASE logic
  • Pre-aggregations for very large datasets

These transformations benefit from being:

  • Centralised
  • Executed once
  • Reused consistently

Teams that moved this type of logic into SQL saw fewer discrepancies and better long-term performance.

What Data Transformation Works Best in Power BI

Power BI (via Power Query) excels when transformations are:

  • Report-specific
  • Likely to change
  • Exploratory or presentational

Common real-world examples include:

  • Renaming columns for clarity
  • Splitting or merging fields for reporting
  • Handling occasional nulls or inconsistencies
  • Shaping data specifically for a visual

Power Query works best when analysts need:

  • Visibility into transformations
  • Faster iteration
  • Control without database dependency

Projects that kept Power BI transformations light and intentional scaled more cleanly.

Where Teams Commonly Run Into Trouble

Problems arise when boundaries aren’t defined.

Common scenarios seen in real projects:

  • Business rules split between SQL and Power BI
  • The same transformation repeated in multiple datasets
  • SQL views doing heavy formatting “for convenience”
  • Power Query handling joins across millions of rows

Over time, this leads to:

  • Inconsistent numbers
  • Slower refreshes
  • Difficult troubleshooting
  • High dependency on individuals

A Practical Decision Framework (That Actually Holds Up)

Teams that avoided these issues usually followed a simple principle:
Transform for structure in SQL.
Transform for shape in Power BI.

In practice:

  • If the transformation defines what the data means → SQL
  • If it defines how the data is presented or consumed → Power BI

This separation reduces rework and keeps logic traceable.

This balance between SQL and Power BI is where many real projects either stabilise — or slowly accumulate technical debt. For readers interested in how this separation is handled in practice, this Power BI + SQL approach is explained here: Power BI with SQL

Performance Is a Symptom, Not the Root Cause

Performance problems often trigger the SQL vs Power BI debate.

But in most cases:

  • Performance issues expose poor transformation placement
  • Not insufficient hardware or tools

Teams that revisited where transformations lived — rather than how fast they ran — achieved more durable improvements.

Collaboration and Ownership Matter

Another recurring lesson is ownership.

  • SQL transformations are often owned by data teams
  • Power BI transformations are owned by report developers

When logic is placed in the wrong layer:

  • Changes slow down
  • Communication breaks
  • Responsibility becomes unclear

Good transformation decisions consider who will maintain the logic six months from now, not just who can build it fastest today.

Final Thought

The question isn’t:
“Can this transformation be done in SQL or Power BI?”

It’s:
“Where should this transformation live so the solution stays clear, fast, and maintainable over time?”

Projects that answered that question deliberately avoided many of the issues others struggled with later.


Learning How to Place Transformations in the Right Layer

For those looking to understand how data transformation fits into real Power BI architectures, the Power BI + SQL course by ExcelGoodies focuses on practical design decisions across SQL, Power Query, and Power BI — based on real reporting scenarios.

Check the Upcoming batch details
 

Editor’s Note

This article curates recurring transformation-related patterns observed across SQL-backed Power BI projects, including post-deployment reviews, performance investigations, and model redesigns. The focus is on where transformations consistently caused friction — and where they aged well over time.

Insights compiled with inputs from the ExcelGoodies Trainers & Power Users Community.
 

MS-SQL

New

Next Batches Now Live

Power BIPower BI
Power BISQL
Power BIPower Apps
Power BIPower Automate
Power BIMicrosoft Fabrics
Power BIAzure Data Engineering
Explore Dates & Reserve Your Spot Reserve Your Spot