---
schema_version: "1"
id: de2a88c8ecc5017fa9ff089cad992a5c19ecdc89f705b22f8e91a4bb5280f2ff
title: dim2mea Transformation
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_dim2mea_transformation.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_dim2mea_transformation.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 3cdf9991e0b2ed7c2805b038ddd475baaeebb943e172bf37606afa77215c2333
description: The dim2mea Transformation creates a new measure based on a dimension. The transformation adds the new measure column to the dataset. The transformation also preserves the dimension to ensure that lenses and dashboards don’t break if they use the dimension.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# dim2mea Transformation

The dim2mea Transformation creates a new measure based on a dimension. The transformation adds the new measure column to the dataset. The transformation also preserves the dimension to ensure that lenses and dashboards don’t break if they use the dimension.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note To convert a dimension to a measure in a Data Prep recipe, see [Text to Number Transformation: Convert the Column Type](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_transformation_dimensiontomeasure.htm&release=264.0.0&type=5 "When you load data into a dataset, CRM Analytics tags a number (measure) column as text (a dimension) if it contains unexpected strings or characters. To perform a calculation on the column, such as calculating the average, use the Text To Number transformation to change the Text column type to Number. You can perform calculations on number columns only."). To do it in a Data Prep Classic recipe, see [Convert a Dimension Field Type to Measure](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_data_prep_recipe_convert_dim_to_measure.htm&release=264.0.0&type=5 "When you load data into a dataset, CRM Analytics tags a measure field as a dimension if it contains unexpected strings or characters. To use measure functionality, such as calculating the average, use the To Measure transformation to change the dimension field type to measure.").

During the column type conversion, the Dimension to Measure transformation rounds decimals to the nearest whole number. For example, 300.2939 becomes 300.

If the transformation cannot create a measure from a dimension, the transformation populates the measure with the specified default value. If no default value is provided, the transformation inserts ‘0.’

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_example.png)

Example

Let’s look at an example. Your Opportunity object contains a custom text field called StageVal\_\_c, which contains the opportunity amount at a particular stage. Because this is a text field, CRM Analytics loads this data as a dimension. However, you’d like to create a measure from this dimension to enable users to perform calculations on stage amount.

You create the following dataflow definition.

```
{    
   "Extract_Opportunities": {        
      "action": "sfdcDigest",        
      "parameters": {            
         "object": "Opportunity",
         "fields": [                
            { "name": "Id" },                
            { "name": "Name" },                
            { "name": "Amount" },                
            { "name": "StageName" },                
            { "name": "CloseDate" },                
            { "name": "AccountId" },                
            { "name": "StageVal__c" }            
         ]  
      }    
   },    
   "Create_Measure_From_Dimension": {        
      "action": "dim2mea",        
      "parameters": {            
         "dimension": "StageVal__c",            
         "measure": "StageValue",            
         "measureDefault": "0",           
         "measureType": "long",            
         "source": "Extract_Opportunities"        
      }    
   },    
   "Register_The_Dataset": {        
      "action": "sfdcRegister",        
      "parameters": {            
         "alias": "OpportunitiesWithConvertedMeasure",            
         "name": "OpportunitiesWithConvertedMeasure",            
         "source": "Create_Measure_From_Dimension"        
      }    
   }
}
```

- **[dim2mea Parameters](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_dim2mea_transformation_operation.htm&release=264.0.0&type=5)**  
    When you define a dim2mea transformation, you set the action attribute to `dim2mea` and specify the parameters.