Sub topic 1
Know your fields: categorical, numeric, date and geographic data
Prerequisites
This chapter assumes you can open the Power BI Desktop report canvas and that a data model is already loaded, with tables and relationships. You should also know basic aggregations such as sum, average and count.
Why field type decides the visual
Every column in your model has a data type, and Power BI uses it to decide what a visual can do with the field. A numeric field can be summed. A date field can form a time axis. A text field can only be grouped or counted. Before you pick a chart, classify each field you plan to use. The class limits which visuals make sense.
The four field classes
| Class | Typical examples | What it does in a visual | Visuals that fit |
|---|---|---|---|
| Categorical | Product Category, Region, Customer Segment | Groups data into slices, bars or rows | Bar, column, treemap, donut, table |
| Numeric | SalesAmount, Quantity, ListPrice | Gets aggregated into a value | Any visual that has a Values or Y-axis well |
| Date/time | OrderDate, Month, Fiscal Year | Orders data along a time axis | Line, area, column over time |
| Geographic | Country, State, City, Latitude | Places data on a map | Map, filled map |
Categorical fields
Categorical fields hold labels. They split a measure into groups. Some have a natural order, such as "Low, Medium, High", and some do not, such as product names. If the order matters, add a sort-by column so it does not default to alphabetical. A categorical field with hundreds of distinct values makes a poor axis. Filter it to a top N or group it first.
Numeric fields
Numeric fields hold quantities you can aggregate. Not every number is a quantity, though. A column such as CustomerID or PostalCode is stored as a number but behaves as a category. Summing it is meaningless. Power BI shows a sigma symbol next to fields it treats as summable. If an ID column shows a sigma, set its Summarization to "Don't summarize" in the Column tools ribbon.
Date and time fields
A date field lets Power BI build a time axis. For reliable time comparisons, use a dedicated date table that is marked as a date table. Measures such as prior-year comparisons depend on it. A continuous date axis spaces points by real time. A categorical axis, such as month names as text, treats each value as a separate label and can hide gaps.
Geographic fields
Geographic fields are text or coordinates that Power BI can place on a map. Set the Data category (for example Country/Region, City or Latitude) in the Column tools ribbon so the map engine reads the value correctly. Ambiguous names such as "Springfield" can plot in the wrong place unless you also supply a state or country.
Checking field types in Power BI
- Open the Data pane and select a column.
- In Column tools, review the data type, Data category and Summarization settings.
- Correct any ID, postal code or year column that is wrongly set as summable.
Field type to visual shortcut
Categorical + numeric -> bar or column chart
Date + numeric -> line chart
Categorical + categorical -> matrix
Geographic + numeric -> map
Numeric + numeric -> scatter chartExercise
Your Sales table has a numeric column named ProductID. A bar chart shows a giant bar after you drop ProductID into the Values well. What went wrong, and how do you fix it?
Show answer
ProductID is an identifier, so it is categorical even though it is stored as a number, and Power BI summed it. Set its Summarization to "Don't summarize" in Column tools and use a product name column as the axis.