# sort by

Sort the rows of the input table into order by one or more columns. Default is **descending order**

### 🦄 Example: Intune audit log for the past 7 days

Sort by TimeGenerated column in ascending order.

```
IntuneAuditLogs 
| where TimeGenerated > ago (7d)
| sort by TimeGenerated asc 
```

<figure><img src="https://3533425259-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbx8yn20QqNJtsVaH9CY7%2Fuploads%2F0kbivIZ6oYwPmuySUYbr%2Fimage.png?alt=media&#x26;token=439fa90e-1d37-434d-980f-b708444ab378" alt=""><figcaption></figcaption></figure>
