如何在Microsoft Access数据表中用表达式生成器计算用户输入值的20%?
How to Create a New Column Calculating 20% of a Value Using an Expression Builder
Hey there! No worries about your initial broad question—let’s walk through exactly how to do this, since it’s a common task across most data tools with expression builders. The core idea is simple: multiply your existing total amount column by 0.2 (or 20%) to get the desired value. Here’s a step-by-step breakdown for some of the most popular tools:
General Core Logic
The formula you’ll use is always some variation of:
[Your Total Amount Column] * 0.2
(Or [Your Total Amount Column] * 20%—most tools accept either format.)
Step-by-Step for Common Tools
Excel (Power Query Editor)
- Open your Excel file and go to the Data tab, then click From Table/Range to launch Power Query.
- In the Power Query Editor, select the Add Column tab.
- Click Custom Column to open the expression builder.
- In the formula box, paste (or type) the formula, replacing
[Total Amount]with your actual column name:[Total Amount] * 0.2 - Rename the new column (e.g., "20% of Total") in the field at the top of the dialog, then click OK.
- Click Close & Load to apply the changes back to your Excel table.
Power BI
- Go to the Data view (the leftmost icon that looks like a table).
- Select your target table from the Fields pane.
- Click the Modeling tab, then choose New Column.
- In the formula bar (which acts as the expression builder), enter:
Replace20% of Total = 'Your Table Name'[Total Amount] * 0.2'Your Table Name'and[Total Amount]with your actual table and column names. - Press Enter, and the new column will appear in your table.
Microsoft Access
- Open your Access table in Datasheet View.
- Go to the Fields tab, then click Calculated Field (under the Add & Delete group).
- Select Number from the dropdown to open the expression builder.
- Enter the formula:
[Total Amount] * 0.2 - Name your new column (e.g., "20% Value") in the Field Name box, then click OK.
Quick Tips
- If your column name has spaces or special characters, always wrap it in square brackets (like
[Total Amount USD]). - Double-check that your original column is formatted as a number/currency—if it’s text, the calculation won’t work.
Let me know if you’re using a specific tool I didn’t cover, and I can adjust the steps for you!
内容的提问来源于stack exchange,提问作者Cøded Numbers
相关产品推荐
相关产品推荐

