Use AI with formulas

Sigma’s formula assistant uses AI to write new formulas, correct formula errors, and explain existing formulas applied to elements in workbooks and data models. These AI capabilities can help enhance productivity and accuracy, ensuring you get the most out of custom calculations and available functions.

This document explains how to use the formula assistant to write, correct, and explain formulas.

🚩

The use of AI features is subject to the following disclaimer.

System and user requirements

The ability to use AI with formulas requires the following:

  • An AI provider must be be configured for your organization. See Configure an AI provider.
  • You must be the workbook or data model owner or be granted Can explore or Can edit document permission.
  • You must be assigned an account type with the Use AI with formulas permission enabled. See Account types.

Write a formula with AI

The formula assistant evaluates your description of calculations, data references, manipulations, and other context, then suggests a formula to achieve the desired output.

  1. To use the formula assistant in a workbook, open the workbook in Explore or Edit mode. To use the formula assistant in a data model, open the data model's workbook page.

  2. In the element you want to update, select an existing column or create one to access the formula bar.

    📘

    For tables, pivot tables, and input tables, you can select or create a column in the Element properties > Columns list or directly within the element. For visualizations, you can accomplish this in the Element properties > Columns list or in the underlying data table.

  3. In the formula bar, click Formula assistant to open the menu, then select Write a new formula.

    Table showing an empty column. Formula assistant menu displayed with cursor over the "Write a new formula" option.

  4. In the AI write formula modal, generate and apply a formula suggestion:

    1. In the Description field, describe the formula or desired output.

    2. Click Write formula to submit the prompt.

    3. In the AI response field, review the formula suggestion:

      • To generate a different formula, repeat the previous steps (4a and 4b) with a modified description.
      • To apply the suggested formula to the column, click Use formula.
      Formula assistant with a prompt to write a formula to calculate gross profit margin with revenue and COGS and a formula response of If([REVENUE] = 0 or IsNull([REVENUE]) or IsNull([COGS]), Null, ([REVENUE] - [COGS]) / [REVENUE])

    The column immediately reflects the output of the applied formula.

Correct a formula with AI

When Sigma detects a formula error, the formula assistant interprets the intent of your original formula and either suggests valid formulas or provides information about the error and how to correct it. You can use the assistant to correct formulas in existing columns (typically indicated by Incomplete formula, Invalid Query, or Unknown column cell values) or correct a manually entered formula when adding a new column.

  1. To use the formula assistant in a workbook, open the workbook in Explore or Edit mode. To use the formula assistant in a data model, open the data model's workbook page.

  2. In the element you want to update, select an existing column containing a formula error, or create a new column and manually enter a formula. If your formula contains an error, Sigma highlights the formula bar with an orange border and displays a warning icon ().

    📘

    For tables, pivot tables, and input tables, you can select or create a column in the Element properties > Columns list or directly within the element. For visualizations, you can accomplish this in the Element properties > Columns list or in the underlying data table.

  3. In the formula bar, click Formula assistant to open the menu, then select Correct this formula.

    Table showing a column with a formula error. Formula assistant menu displayed with cursor over the "Correct this formula" option.

  4. In the AI correct formula modal, the formula assistant suggests valid formulas or explains how to correct the existing formula. To replace the invalid formula with a suggestion, click Apply.

    AI correct formula correcting the incorrect formula of "Quantity" * "Cost" by suggesting valid Sigma syntax. 3 different options display, one showing to use brackets instead of quotes around column names, and two others showing to do that and possibly wrap the column name with the Number function.

    The column immediately reflects the output of the applied formula.

Explain a formula with AI

The formula assistant evaluates an existing formula and explains what it accomplishes. Details can include columns referenced, transformations applied to the data, and other information about the formula output.

  1. To use the formula assistant in a workbook, open the workbook in Explore or Edit mode. To use the formula assistant in a data model, open the data model's workbook page.

  2. In the element containing the formula you want to explain, select the applicable column to access the formula bar.

    📘

    For tables, pivot tables, and input tables, you can select a column in the Element properties > Columns list or directly within the element. For visualizations, you can accomplish this in the Element properties > Columns list or in the underlying data table.

  3. In the formula bar, click Formula assistant to open the menu, then select Explain this formula.

    Table showing a column generated by a formula. Formula assistant menu displayed with cursor over the "Explain this formula" option.

  4. In the AI explain formula modal, the formula assistant displays the AI-generated explanation. To view an alternative explanation, repeat the previous step.

    AI explain formula for "DateTrunc('day', [Date] formula, with the explanation: "the date in the column date, trimmed down to the day.")