July 24, 2025

How to Dynamically Update Chart Axis, Rows, Columns, or Metrics by User Selection in Sigma Computing

By Balivada Ganesh Bhargav

As organizations face faster decision-making demands, static dashboards often fall short of expectations. Users want flexibility – the power to explore data from multiple angles without building multiple versions of the same visual. Sigma Computing offers this flexibility. One useful feature is Segmented Controls, which allows the creation of dynamic, user-driven dashboards.

In this blog, we’ll explore how to use Sigma’s segmented controls and custom calculations to dynamically switch visual axes or pivot table rows and columns, giving your end-users a more interactive experience.

Context

Sigma offers the ability to create custom calculations for nearly every visualization part, including the X-axis, Y-axis, and pivot table rows/columns. By pairing this with segmented controls (toggle buttons or radio-style selection), we can drive dynamic behavior based on the viewer’s selection.

This setup mimics conditional logic (like a SWITCH or CASE statement) and allows you to switch the dimension or metric shown in a chart or pivot with a single click.

Real-World Use Case: Let the Viewer Choose the View

Imagine you’re building a dashboard for a Sales Operations team. They want to analyze performance across multiple dimensions – by Region, Salesperson, and Product Category. Traditionally, you’d have to create three separate visuals or pivot tables for each view.

But with Sigma’s segmented controls and custom calculations, you can let the user decide.

With a simple dropdown or segmented control, the viewer can toggle between these dimensions, and the chart or pivot automatically updates — no duplicated visuals, no extra clutter.

This approach also applies to:

  • Finance teams are toggling between Monthly, Quarterly, and Yearly metrics.

  • Marketing teams are switching between Channel, Campaign, and Region.

  • HR dashboards showing headcount by Department, Location, or Seniority

It’s one setup — Flexibility.

Making a Bar Chart Dynamic: X and Y Axes

Let’s begin with a bar chart, one of the most common visualizations. But we’re not stopping at the basics—we’re making both the X-axis and Y-axis dynamic so the user can interactively change what the chart shows without needing to rebuild or duplicate visuals.

What Are We Making Dynamic?

X-Axis (Dimension):
The viewer can choose from:

  • Quarter

  • Product Family

  • Region

Y-Axis (Metric):
The viewer can select:

  • Sales

  • Profit

  • Profit Margin

With a single bar chart, users can easily switch between different breakdowns (e.g., Sales by Region, Profit Margin by Product Family, etc.) using segmented controls. Sigma will use custom calculations to switch the axis values dynamically based on user input.

This setup makes your dashboard cleaner, more interactive, and more flexible — perfect for executive summaries or exploratory analysis.

Step-by-Step Implementation: Creating Dynamic Axes with Segmented Controls

Step 1

Add two segmented controls from the Controls option in Sigma — one will drive the X-axis (dimension), and the other will control the Y-axis (metric).

Step 2: Rename the Controls

  • Rename the first control to “Dimension Selector”.

  • Rename the second control to “Metric Selector”.

Step 3: Configure the Dimension Selector

  • Click on the Dimension Selector control.

  • In the Properties tab, choose manual list as the value source.

  • Add the following text values:

    • quarter

    • product-family

    • region

  • Enable Set display values, and map each text value to a clean label
    (e.g., quarter → Quarter, product family → Product Family)

  • Set the Value Type to Text.

  • Make the control Required to ensure a selection is always made.

  • Set a control ID for our Dimension Selector. You’ll reference this ID in your custom calculation later.

  • Once your Dimension Selector is ready, repeat similar steps for the Metric Selector.

Step 4: Connect the Bar Chart’s X-Axis to the Dimension Selector

Now that our controls are in place, let’s make the bar chart respond to user input.

  • Start with a Bar Chart

    • Add a Bar Chart to your Sigma workbook.

    • Instead of selecting a fixed column for the X-axis,
      we will use a Custom Calculation.

  • Set Up the X-Axis Dynamically

    • Click on the X-axis field in the bar chart.

    • Choose Custom Calculation.

    • Paste the following formula:

				
					Switch(
  [Dimension-Selector],
  "quarter", Text(Year([Date])) & "-" & "Q" & Text(Quarter([Date])),
  "product-family", [Product Family],
  "region", [Store Region]
)

				
			

Switch statement: It looks at the user’s selection from the Dimension-Selector control.

  • Depending on the value chosen, it dynamically returns:

    • A formatted string like “2023-Q2” if the user selects "quarter"

    • The Product Family field if "product-family" is selected

    • The Store Region field if "region" is selected

This allows you to use a single formula to drive different breakdowns on your bar chart.

    • Finally, rename your Axis from “Calc” to “Dimension Selector”.

Step 5: Make the Y-Axis Dynamic Using Metric Selector

Just like we did for the X-axis, we’ll now make the Y-axis respond to the user’s selected metric—sales, Profit, or Profit Margin.

  • Add a Custom Calculation to the Y-Axis

  • Click on the Y-axis of your existing bar chart.

    • Choose Custom Calculation.

    • Paste the following formula:

				
					Switch(
  True,
  [Metric-Selector] = "sales", Sum([Sales]),
  [Metric-Selector] = "profit", Sum([Profit]),
  [Metric-Selector] = "profit-margin", Sum([Sales] - [COGs]) / Sum([Sales])
)

				
			

Benefits of Switch Statement: It looks at the user’s selection from the dimension_selector control.

  • It checks which option the user selected via the Metric-Selector control.

  • Based on the selection, it returns the corresponding aggregated value:

    • If the selection is "sales", it calculates Sum([Sales])

    • If it’s "profit", it uses Sum([Profit])

    • If "profit-margin" is selected, it calculates profit margin using the formula: (Sales - COGS) / Sales

    • Rename your Y-axis to “Metric Selector”.

Step 6: Make the Chart Title Dynamic

Now that your X and Y axes are dynamic, let’s bring the same interactivity to the chart title.

Sigma allows you to use dynamic expressions in titles by starting with an = sign.
This enables the title to update in real-time based on user selections.

Update the Title Dynamically

  • Click on the chart title.

  • Select Dimension Selector and type an = sign. This will open the formula bar, similar to the text interaction.

  • It combines the current metric selection and dimension selection into a readable string.

  • Upper() is used to format the text in all caps for a bold, clean look.

  • For example, if the user selects sales and region, the title will display:
    SALES by REGION

  • You can customize the casing or formatting further depending on your style preferences.

What About Pivot Tables?

The same dynamic approach works beautifully with Pivot Tables in Sigma.

You can use segmented controls to let users switch Rows, Columns and Values.

Just like with bar charts, you’ll:

  • Create segmented controls for each area
    (e.g., Row Selector, Column Selector, Metric Selector)

  • Use Switch() or conditional logic in custom calculations to return the appropriate field based on the control input.

  • Dynamically assign those calculations to the pivot’s Row, Column, and Values sections.

  • The logic stays the same — you’re just swapping axes for pivot layout options.

Interactive by Design: The Sigma Way

By leveraging segmented controls and custom calculations, you can turn static Sigma visuals into powerful, dynamic tools — all without duplicating charts or dashboards.

In this post, we walked through how to:

  • Dynamically change X and Y axes on a bar chart using user selections

  • Build interactive chart titles that reflect the current context.

  • Extend the same technique to pivot tables for dynamic rows, columns, and values.

This approach not only simplifies your dashboard design but also gives your users control, letting them explore data the way they want, when they want.

Try implementing this in your next Sigma project and watch your dashboards go from static to smart.

Closing

Using Sigma’s segmented controls with Switch() logic enables scalable, dynamic visual design. You can efficiently switch dimensions, metrics, and titles without duplicating visuals, keeping dashboards clean and interactive.

This technique is lightweight, reusable, and works across most chart types and pivot tables, making it a best practice for building modular, user-driven analytics in Sigma.

FAQs

Yes! That’s one of the biggest advantages. A single control can drive multiple visuals simultaneously, keeping your dashboard consistent and responsive.

Absolutely. This approach works across most Sigma visuals, including line charts, area charts, tables, and combo charts—anywhere custom calculations are supported for axes/values.

When dynamically switching columns or calculations, a single Switch() function in Sigma can reference a hard limit of 7 fields.

Use custom formatting logic within the visual (e.g., show decimals for margin, currency for sales)

Data Coach is our premium analytics training program with one-on-one coaching from renowned experts.

Accelerate and automate your data projects with the phData Toolkit