# SELECT

The SELECT function returns the range of cells between the start and end columns of a specified measure. It should be used in conjunction with an aggregate function such as SUM, AVERAGE, RANK, etc.

## Syntax

```javascript
SELECT(measure,start_column,end_column)
```

## Arguments

measure - String. Specify the measure name for which the data range must be retrieved. Leaf-level cells will be taken.

start\_column - Number. The starting column index from which the data must be fetched (1-based indexing). Required.

end\_column - Number. The index of the ending column until which data has to be retrieved. Optional. If left blank, only the data from the start\_column will be returned.

## Return value

Range of data.

## Example

{% code overflow="wrap" %}

```javascript
SELECT([Sales],1,3)

//Returns the range of cells between the first and the third column of the 'Sales' measure

SUM(SELECT([Sales],1,3))

//Calculates the sum of values from the first through third columns of the 'Sales' measure
```

{% endcode %}

In the example below, we used the SELECT function to determine the rank of multiple categories. The rank is derived from the first through fifth columns of the 'Sales' measure.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(2748).png" alt=""><figcaption><p>SELECT with RANK</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/formula-syntax/measure-column-selection-functions/select.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
