When you connect to a data source, Tableau automatically assigns type (measure or dimension) to each field in your data source. However, you can always change them manually by right-clicking on the field name under Measures/Dimensions and selecting Convert to Dimension / Convert to Measure: