Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Lens Explorer entry
How-to guide

Build a Lens in CRM Analytics

Lens authoring is the fastest path from raw data to a question answered. Most lenses come together in five minutes.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 21, 2026

Lens authoring is the fastest path from raw data to a question answered. Most lenses come together in five minutes.

  1. Open the dataset

    Analytics Studio, find the target dataset, click Explore. The Lens Explorer opens with the dataset selected.

  2. Pick the measure

    The measure is the value to display (Sum of Amount, Count of Records, Average of Age). Drag from the field panel onto the Bars shelf.

  3. Add groupings

    Drag categorical fields (Region, Industry, Stage) onto the Bars shelf to group the measure. The chart updates immediately.

  4. Add filters

    Drag a field onto the Filter shelf or use the Filter button. Common filters: this quarter, this year, specific values.

  5. Pick the right chart type

    Bar for category comparison, line for trends, donut for share-of-whole. The Explorer suggests defaults based on the field types.

  6. Save the Lens

    Click Save. Name the lens descriptively. The lens is now reusable in dashboards and shareable with the team.

Mandatory fields
Datasetrequired

The underlying data the lens queries.

Measurerequired

The numeric value to display.

Grouping fieldsrequired

Categorical fields that pivot the measure.

Filtersrequired

Scope the lens to the relevant subset.

Chart typerequired

Visualization shape that matches the data structure.

Gotchas
  • Lens performance depends on dataset design. Slow datasets produce slow lenses regardless of the lens-level configuration.
  • SAQL mode unlocks features Explorer UI does not expose. Saving a SAQL-mode lens prevents future edits in Explorer mode; switching back can lose unsaved changes.
  • Sharing lenses requires sharing the underlying dataset. A shared lens against a dataset the recipient cannot access shows an error, not the chart.
  • Tableau is the long-term strategic direction. New analytics investments should consider Tableau alongside CRM Analytics.

See the full Lens Explorer entry

Lens Explorer includes the definition, worked example, deep dive, related terms, and a quiz.