SaTracking
PlatformsNEWIntermediate

Prepare reliable Power BI data with Power Query and Applied Steps

Build a repeatable import and cleaning sequence by checking data types, distinguishing errors from missing values, and validating each transformation.

Download for AI (.txt)

Measurement topic illustration · SaTracking

Audience and learning objectives

Inspect types before aggregation, separate errors from nulls and zeros, and gate the applied query on row counts, key uniqueness and control totals. You will learn to inspect a source before modeling it, use the Applied Steps history as a reviewable transformation sequence, and handle errors without silently changing business meaning. Skill: intermediate. Reading time: eight minutes.

1. Treat import as a controlled pipeline

The source workshop uses a CSV dataset to demonstrate the workflow. The important lesson is not the specific file format: it is that source data should be checked before visuals are built. A reliable sequence is:

  1. Connect to the source and select the intended table or file.
  2. Inspect column names, sample values and detected data types.
  3. Correct types that do not match the field's meaning.
  4. Resolve malformed or missing values using an explicit rule.
  5. Rename, remove or derive columns to create a usable analytical shape.
  6. Review the resulting steps and apply the query.
  7. Refresh from the source and verify that the same rules still work.

Do not begin by building visuals on top of an unreviewed import. A chart can render successfully while the underlying values are typed or interpreted incorrectly.

2. Validate data types before aggregation

A number stored as text may sort alphabetically, fail arithmetic, or be excluded from numeric aggregation. A date stored as text may not behave as a date axis. Check the type against the business meaning, not just the appearance of the values.

Example fieldExpected typeValidation question
yearWhole number or date, depending on the modelIs it a year label or a full date?
life_expDecimal numberAre decimal values parsed consistently?
populationWhole numberAre separators and large values interpreted correctly?
countryTextAre labels stable and consistently spelled?
latitude, longitudeDecimal numberAre signs and decimal separators correct?

The source workshop specifically identifies a life-expectancy field imported as text and demonstrates changing its type before analysis. Apply the same discipline to every important measure and grouping field.

3. Understand the Applied Steps list

Power Query records transformations as ordered steps. The Applied Steps list is not just an undo history: it is a compact explanation of how the source becomes the table used by the model.

  • Selecting a step lets you inspect the intermediate result.
  • Renaming a column makes later steps and report fields easier to understand.
  • Removing unused columns reduces clutter and can reduce unnecessary model data.
  • Replacing values should be based on a documented mapping, not guesswork.
  • A step that depends on a column name can fail when the source schema changes.

When a step fails, inspect the first failing step and its inputs. Do not delete several later steps just to make the warning disappear; that can conceal the original cause.

4. Distinguish errors, nulls and valid zeroes

These values mean different things:

  • Error: Power Query could not evaluate or convert a value.
  • Null / blank: the source has no value, or the transformation intentionally produced one.
  • Zero: a numeric value with a real business meaning.

Replacing every error or blank with zero can distort averages, rates and totals. For example, an unknown population is not a population of zero. Define the treatment field by field: correct the source, map a known invalid code, keep a null, remove a record only with a defensible rule, or quarantine it for review.

Microsoft distinguishes step-level errors, which can prevent a query from loading, from cell-level errors that affect particular values. Diagnose the level before deciding how to repair it.

5. Use a practical quality gate

Before selecting Close & Apply (or the equivalent action in your current interface), check:

  • Row counts before and after transformations.
  • Column names and types.
  • Duplicate keys where uniqueness is expected.
  • Null and error counts in critical fields.
  • Minimum, maximum and representative values for numeric columns.
  • Whether filters or replacements removed legitimate records.
  • Whether the source refresh reproduces the expected result.

For recurring reports, document why each non-obvious transformation exists. Another analyst should be able to understand the step without reverse-engineering the original workbook.

Troubleshooting patterns

SymptomLikely causeFirst check
A numeric field sorts alphabeticallyText typeInspect the detected type and locale parsing
A query fails after a source updateRenamed or removed columnFind the first failing Applied Step
Totals fall after cleaningRows or errors were removedCompare row counts and inspect filtered records
A blank becomes zero in a chartReplacement or aggregation behaviorReview the transformation rule and visual aggregation
Refresh differs from the previewSource changed or credentials/permissions differRefresh against the real source and inspect the error detail

Source and further reading

Adapted from Introduction to Power BI, Monash Bioinformatics Platform / Monash Data Fluency initiative (2020), pp. 13–20. Licensed source material: CC BY 4.0. Current Power Query behavior is cross-checked against Microsoft's guidance on Applied Steps and error handling.

Official references

EDITORIAL HISTORY

What changed

  1. v1.0.0
    Initial bilingual guide synthesized from the Monash Introduction to Power BI source and checked against current Microsoft Learn documentation.
MEASUREMENT SUPPORT

Need a hand with your tracking?

Nicolas Salazar works with teams on analytics, tracking plans, data quality, consent, and implementation.