2.3 Data Types and Type Detection

Key Takeaways

  • Power BI supports data types including Text, Whole Number, Decimal Number, Fixed Decimal, Date, Date/Time, Time, True/False, and Binary.
  • Automatic type detection runs on the first 200 rows and can produce incorrect assignments — always verify.
  • Decimal Number uses 64-bit floating point; Fixed Decimal Number uses exact decimal with 4 decimal places (ideal for currency).
  • Setting the correct data type impacts storage efficiency, sort behavior, aggregation defaults, and relationship creation.
  • The 'Using Locale' option allows parsing dates and numbers with regional formatting differences.
Last updated: March 2026

Data Types and Type Detection

Quick Answer: Power BI auto-detects types from the first 200 rows, which can be wrong. Always verify and manually set types. Use Fixed Decimal for currency (exact, 4 decimal places), Decimal for general numbers (floating point), and Text for identifiers like zip codes and product codes that should never be aggregated.

Power BI Data Types

Data TypeDescriptionStorage SizeExample
TextCharacter strings of any lengthVariable"Hello World"
Whole Number64-bit integer (no decimals)8 bytes42, -100, 0
Decimal Number64-bit floating point8 bytes3.14159
Fixed DecimalExact decimal, 4 decimal places8 bytes19.99
DateDate only (no time)8 bytes2026-03-31
Date/TimeDate with time component8 bytes2026-03-31 14:30:00
Date/Time/TimezoneDate/Time with timezone offset8 bytes2026-03-31 14:30:00 +05:00
TimeTime only (no date)8 bytes14:30:00
True/FalseBoolean value1 byteTRUE, FALSE
BinaryBinary data (images, files)Variable(binary content)
DurationTime span8 bytes2.05:30:00
PercentageDecimal displayed as %8 bytes0.25 (shown as 25%)

Automatic Type Detection

When you first connect to a data source, Power Query automatically detects column types based on the first 200 rows:

How Auto-Detection Works

  1. Power Query scans the first 200 values in each column
  2. It attempts to identify the most appropriate type
  3. A "Changed Type" step is automatically added to the query
  4. If a column has mixed types in the first 200 rows, Text is assigned

Problems with Auto-Detection

ProblemExampleSolution
First 200 rows unrepresentativeAll nulls in first 200 rows, data starts at row 201Profile entire dataset, manually set type
ZIP codes become numbers"07094" becomes 7094 (loses leading zero)Change type to Text
Dates misinterpreted"01/02/2026" — Jan 2 or Feb 1?Use "Using Locale" with correct region
Currency as Decimal$19.99 stored as 19.989999...Use Fixed Decimal Number
IDs become numbersProductID "00123" becomes 123Change type to Text before other steps

Decimal Number vs. Fixed Decimal Number

This distinction is frequently tested:

Decimal Number (Floating Point)

  • Uses IEEE 754 double-precision (64-bit floating point)
  • Can represent very large and very small numbers
  • Subject to floating-point rounding errors

Example of rounding issue: 0.1+0.2=0.30000000000000004 (not exactly 0.3)0.1 + 0.2 = 0.30000000000000004 \text{ (not exactly 0.3)}

Fixed Decimal Number (Currency)

  • Uses exact decimal arithmetic with up to 4 decimal places
  • No floating-point rounding errors
  • Range: -922,337,203,685,477.5808 to 922,337,203,685,477.5807

Best practice: Always use Fixed Decimal Number for monetary values (prices, salaries, revenue) to avoid rounding errors in financial calculations.

Setting Types Manually

In Power Query Editor

Select column → Transform tab → Data Type → Choose correct type

Or click the type icon in the column header (ABC/123/calendar icon).

Using Locale for Regional Formats

When dates or numbers use non-US formatting:

Right-click column → Change Type → Using Locale
→ Select data type and locale (e.g., Date with English (United Kingdom) for DD/MM/YYYY)

This is critical for:

  • Date formats: US (MM/DD/YYYY) vs. European (DD/MM/YYYY)
  • Decimal separators: US uses period (1,234.56) vs. European comma (1.234,56)

Type Impact on Model Behavior

AspectImpact of Data Type
Storage sizeInteger types compress better than text
Sort behavior"1", "10", "2" (text sort) vs. 1, 2, 10 (numeric sort)
Aggregation defaultsNumeric → Sum; Text → Count; Date → Earliest/Latest
Relationship creationBoth columns must have the same data type
Filter behaviorNumeric slicers show range; Text shows dropdown
DAX calculationsWrong types cause implicit conversions or errors

Best Practices for Type Management

  1. Set types in the first step after connecting to data (before other transforms)
  2. Delete the auto-generated "Changed Type" step and create your own explicit one
  3. Use Fixed Decimal for all currency/monetary fields
  4. Keep identifier columns as Text (ZIP codes, product codes, employee IDs)
  5. Use Date (not Date/Time) when time component is not needed — reduces storage
  6. Profile the entire dataset before setting types to catch edge cases

On the Exam

The PL-300 frequently tests:

  • Choosing between Decimal Number and Fixed Decimal Number for currency
  • Identifying problems caused by automatic type detection
  • Using the "Using Locale" option for international date and number formats
  • Understanding how data types affect relationships and DAX calculations
  • Knowing when to use Text type for identifiers that look like numbers
Test Your Knowledge

Which data type should you use for a column containing product prices like $19.99 to avoid floating-point rounding errors?

A
B
C
D
Test Your Knowledge

A European data source uses DD/MM/YYYY date format. How should you ensure Power BI correctly interprets the date "05/03/2026" as March 5, not May 3?

A
B
C
D
Test Your Knowledge

A column contains ZIP codes including values like "07094". After import, the value shows as 7094 with the leading zero removed. What caused this?

A
B
C
D