You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/data-platform/formula-column-data-types.md
+30-24Lines changed: 30 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,9 @@ Create a formula column that returns a decimal number.
39
39
1. Enter a formula that returns a numeric value in the **Formula** bar.
40
40
This example creates a formula column called *Total Amount*. The *Price Per Unit* column is of decimal data type.
41
41
:::image type="content" source="media/formula-columns-decimal-fd.png" alt-text="Screenshot of a create a new formula column pane for use with a decimal number using 'Price Per Unit' * 150.":::
42
-
1. Expand **Advanced options**, select **Decimal** as the **Formula data type**, and then set the required number of decimal places.
42
+
1. Expand **Advanced options**, and then set the required number of decimal places.
43
43
:::image type="content" source="media/formula-columns-decimal-adv-options.png" alt-text="Screenshot of a decimal formula column definition.":::
44
-
1. Select **Save**.
44
+
1. Select **Save**. By default, **Formula data type** is set to **Decimal** and a decimal formula field is created.
45
45
46
46
## Create a whole number formula column
47
47
@@ -50,7 +50,7 @@ Create a formula column that returns a whole number.
50
50
1. Select **Data type** as ***fx* Formula**.
51
51
1. Enter a formula that returns a numeric value in the **Formula** bar.
52
52
This example creates a formula column called *Number of Units*. *Total Price* and *Price Per Unit* columns are of decimal data type.
53
-
:::image type="content" source="media/formula-columns-wholenum-fd.png" alt-text="Screenshot of a create a new formula column pane for use with a whole number..":::
53
+
:::image type="content" source="media/formula-columns-wholenum-fd.png" alt-text="Screenshot of a create a new formula column pane for use with a whole number.":::
54
54
1. Expand **Advanced options**, and select **Whole number** as the **Formula data type** and set the required format for whole number column.
55
55
:::image type="content" source="media/formula-columns-wholenum-adv-options.png" alt-text="Screenshot of a whole number formula column definition using 'Total Price' / 'Price Per Unit'.":::
56
56
1. Select **Save**.
@@ -61,52 +61,58 @@ Create a formula column that returns float.
61
61
62
62
1. Select **Data type** as ***fx* Formula**.
63
63
1. Enter a formula that returns a floating point number in the **Formula** bar.
64
-
This example creates a formula column called *TestFloat*.
65
-
:::image type="content" source="media/formula-columns-float-fd.png" alt-text="Screenshot of a creating float formula column using Float(123) as the formula.":::
64
+
Enter a formula that returns a floating point number in the **Formula** bar. This example creates a formula column called *Total Price*. *Weight* is a simple float column and *Price Per Gm* is a simple decimal column.
65
+
:::image type="content" source="media/formula-columns-float-fd.png" alt-text="Screenshot of a creating float formula column":::
66
66
1. Expand **Advanced options**, and set the required number of decimal places.
67
67
1. Select **Save**.
68
68
69
69
### Guidelines for creating floating point number formula columns
70
70
71
-
- Floating point numbers store an extremely close approximation of a value. Floats are typically used for storing scientific numeric values.
72
71
- If an operand involved in an arithmetic operation is of float type, then the result of the formula is of float type. For example:
73
72
-```1 + 2 + Float(1)``` as it uses a float type operand - ```Float(1)```.
74
73
- A numeric function returns a float value when the first parameter provided to the function is of float type. Otherwise, the function returns a decimal value. For example:
75
74
-```Sum(1, 2, Float(1))``` is of decimal type and ```Sum(Float(1), 1, 2)``` is of float type.
76
75
-```Float```, ```Sqrt```, ```Ln```, ```Power```, ```Exp``` functions and the ```^``` operator return a float value.
77
-
- Float formula columns support a maximum precision of 5.
78
76
79
77
## Create a choice formula column
80
78
81
-
To create a choice formula column, either global choice or local choice of a simple choice column can be used as a result in ```If``` or ```Switch``` functions.
79
+
To create a choice formula column, either global choice or local choice of a simple choice column can be used as result.
82
80
83
81
### Using global choice
84
82
85
-
1. Create a [global choice](custom-picklists.md). This example creates a global choice with a **Display name** that's *Color*.
86
-
1. Add the following **Choices**:
87
-
-**Label**: *Red***Value**: '*858,170,0000*'
88
-
-**Label**: *Pink***Value**: *858,170,001*
89
-
-**Label**: *Yellow***Value**: 858,170,002
90
-
-**Label**: *Blue***Value**: *858,170,003*
91
-
:::image type="content" source="media/global-choice-def.png" alt-text="Screenshot of a global choice.":::
92
-
1. Create a formula column using the global choice. This example creates a formula column *Color Column* using the global choice *Color* created from the previous step.
83
+
Create a global choice. This example creates a global choice called *Task Priority*.
84
+
85
+
:::image type="content" source="media/global-choice-def.png" alt-text="Screenshot of a global choice.":::
86
+
87
+
Create a formula column that returns a choice using a global choice.
88
+
89
+
1. Select **Data type** as ***fx* Formula**.
90
+
1. Enter a formula that returns a choice value in the **Formula** bar.
91
+
This example creates a formula column *Priority* using global choice *Task Priority*.
93
92
:::image type="content" source="media/formula-columns-global-choice-fd.png" alt-text="Screenshot of a creating global choice formula column.":::
94
-
1. Select **Save**. Notice that the column created is of data type **Choice fx**.
93
+
1. Select **Save**. Notice that the column created is of data type **Choice fx**.
95
94
96
95
### Using local choice from a simple choice column
97
96
98
-
1. Create a simple choice column. This example creates a *Simple Color* choice column on the *Account* table.
99
-
:::image type="content" source="media/local-choice-def.png" alt-text="Screenshot of a creating a simple choice column.":::
100
-
2. Create formula column on the same entity as simple choice column using simple choice column's local choice in the formula. This example creates a formula column *Color Column 2* on *Account* entity using local choice column created from the previous step.
97
+
Create a simple choice column. This example creates a *Task Priority* simple choice column for the account table.
98
+
99
+
:::image type="content" source="media/local-choice-def.png" alt-text="Screenshot of a creating a simple choice column.":::
100
+
101
+
Create a formula column that returns choice using a local choice of a simple choice column.
102
+
103
+
1. Select **Data type** as ***fx* Formula**.
104
+
1. Enter a formula that returns a choice value in the **Formula** bar.
105
+
This example creates a formula column *Priority* on *Account* entity using local choice of a choice column *Task Priority* for the account table.
101
106
:::image type="content" source="media/formula-columns-local-choice-fd.png" alt-text="Screenshot of a creating local choice formula column.":::
107
+
1. Select **Save**.
102
108
103
109
### Guidelines for working with choices in formula columns
104
110
105
-
- Local choices of a related table's simple choice column can't be used as result type in formula columns.
106
-
- Options from the same choice column should be used for all result arguments in choice formula columns.
111
+
- Local choices of related table's simple choice column can't be used as a result type in formula columns.
112
+
- Options from the same option set should be used for all result arguments in choice formula columns.
107
113
- A choice used by a formula column can't be updated.
108
-
- Options of a choice can't be passed as an argument to string functions. Value function can be used to return numeric a value of an option.
109
-
-A formula column's dependent local choice column or global choice can't be deleted.
114
+
- Options of a choice can't be passed as an argument to string functions. Value function can be used to return the numeric value of an option.
115
+
-Formula column's dependent local choice column or global choice can't be deleted.
0 commit comments