# Using the O365 Excel integration in a metric

This guide explains how to use the Excel (Office 365) integration to create a metric in Smaply. After setting up the integration, you can map your Excel spreadsheet data to a metric and visualize it as a chart.

<figure><img src="https://1197101183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2For99xDEElfps9uMDY60K%2Fuploads%2FvRE4kLPHMsSTBq9RbMbv%2Fimage.png?alt=media&#x26;token=6ffdd9bd-91f4-4af6-a295-ee2ff0b99add" alt=""><figcaption></figcaption></figure>

### Step 1: Add a Metric

1. Navigate to the **Metrics** section in Smaply.
2. Click **Add Metric**.
3. Enter a descriptive **Name** for your metric (e.g., "Employee Salary").

### Step 2: Select Excel as the Data Source

1. In the **Source** dropdown, select **Excel (Office 365)**.
2. Choose the metric **Type** (e.g., Series).

### Step 3: Select Your Excel File and Sheet

1. Click **Change** to select an Excel file from your connected Office 365 account.
2. Select the relevant **Sheet** from the file.
3. (Optional) Check **Make top row headers** if your data has labeled columns in the first row.

### Step 4: Map Data Fields

1. **Data Label:** Choose the column that represents the category or labels for your metric (e.g., "Full Name").
2. **Data Values:** Select the numerical column that you want to use for the chart visualization (e.g., "Annual Salary").
3. (Optional) **Select bottom rows** if you want to pull data from the bottom of the sheet instead of the top. For example, selecting 10 rows from a sheet with 1,000 rows will take the last 10 instead of the first 10.
4. (Optional) **Number of rows:** Specify how many rows of data should be included (maximum of 50).

### Step 5: Finalize and Save

1. Review your selections to ensure the correct data mapping.
2. Click **Save** to generate the metric.
3. Your metric will now be visualized based on the selected data.

### Troubleshooting

* **No data appearing?** Ensure that the selected Excel sheet contains the correct headers and data.
* **Incorrect values displayed?** Verify that numeric data is mapped under **Data Values**.
* **Can't connect to Excel?** Check your Office 365 authentication and permissions.
