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.
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 Type | Description | Storage Size | Example |
|---|---|---|---|
| Text | Character strings of any length | Variable | "Hello World" |
| Whole Number | 64-bit integer (no decimals) | 8 bytes | 42, -100, 0 |
| Decimal Number | 64-bit floating point | 8 bytes | 3.14159 |
| Fixed Decimal | Exact decimal, 4 decimal places | 8 bytes | 19.99 |
| Date | Date only (no time) | 8 bytes | 2026-03-31 |
| Date/Time | Date with time component | 8 bytes | 2026-03-31 14:30:00 |
| Date/Time/Timezone | Date/Time with timezone offset | 8 bytes | 2026-03-31 14:30:00 +05:00 |
| Time | Time only (no date) | 8 bytes | 14:30:00 |
| True/False | Boolean value | 1 byte | TRUE, FALSE |
| Binary | Binary data (images, files) | Variable | (binary content) |
| Duration | Time span | 8 bytes | 2.05:30:00 |
| Percentage | Decimal displayed as % | 8 bytes | 0.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
- Power Query scans the first 200 values in each column
- It attempts to identify the most appropriate type
- A "Changed Type" step is automatically added to the query
- If a column has mixed types in the first 200 rows, Text is assigned
Problems with Auto-Detection
| Problem | Example | Solution |
|---|---|---|
| First 200 rows unrepresentative | All nulls in first 200 rows, data starts at row 201 | Profile 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 numbers | ProductID "00123" becomes 123 | Change 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:
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
| Aspect | Impact of Data Type |
|---|---|
| Storage size | Integer types compress better than text |
| Sort behavior | "1", "10", "2" (text sort) vs. 1, 2, 10 (numeric sort) |
| Aggregation defaults | Numeric → Sum; Text → Count; Date → Earliest/Latest |
| Relationship creation | Both columns must have the same data type |
| Filter behavior | Numeric slicers show range; Text shows dropdown |
| DAX calculations | Wrong types cause implicit conversions or errors |
Best Practices for Type Management
- Set types in the first step after connecting to data (before other transforms)
- Delete the auto-generated "Changed Type" step and create your own explicit one
- Use Fixed Decimal for all currency/monetary fields
- Keep identifier columns as Text (ZIP codes, product codes, employee IDs)
- Use Date (not Date/Time) when time component is not needed — reduces storage
- Profile the entire dataset before setting types to catch edge cases
Type Detection and the "Changed Type" Step
A subtle but heavily tested behavior: when you connect to a source, Power Query silently appends a "Changed Type" step inferred from the first 200 rows. If you later add or rename columns, this auto step can throw "the column X of the table wasn't found" errors or quietly re-coerce a column you meant to keep as Text. Best practice is to delete the auto-generated Changed Type step and add your own explicit one as the first action, so type assignment is intentional and survives schema changes.
| Symptom | Root cause | Fix |
|---|---|---|
Leading zeros disappear (07094→7094) | Auto-typed as Whole Number | Set Text before any other step |
| Dates off by months | Locale mismatch (DD/MM vs MM/DD) | Change Type → Using Locale |
| Currency totals a cent off | Decimal (floating point) | Use Fixed Decimal Number |
Exam Tip: Identifiers that look numeric but are never summed — ZIP codes, phone numbers, product SKUs, account numbers — should be Text. Keeping them numeric not only drops leading zeros but also gives them a misleading default Sum aggregation in report visuals.
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
Which data type should you use for a column containing product prices like $19.99 to avoid floating-point rounding errors?
Fixed Decimal Number
Decimal Number
Whole Number
Text
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?
Use Replace Values to reformat the dates
Set the column type to Text
Create a calculated column with a DATE function
Change Type → Using Locale with the appropriate European locale
A column contains ZIP codes including values like "07094". After import, the value shows as 7094 with the leading zero removed. What caused this?
Auto type detection set the column as Whole Number, removing the leading zero
A Replace Values step removed the zero
The source data did not include the leading zero
Power BI cannot display leading zeros
Sections you finish are checked off in the contents.