Skip to content

Excel ​

This guide builds the three tiles from the Recipes in Excel with Power Query. The tiles are due and overdue checks, completed against scheduled, and open actions. Excel and Power BI use the same query language, so the queries are the ones in the Power BI guide. This page covers what's different in Excel.

These steps use Excel for Microsoft 365 on Windows. You need an API key with hierarchy:read, checks:read and actions:read. See Getting Started.

The workbook holds the key

Power Query stores parameter values in the workbook, so anyone who can open the file can read the key. Use a client with only the permissions and factories this workbook needs, keep the file somewhere access-controlled, and don't email it. See Security.

1. Open Power Query ​

Select Data → Get Data → Launch Power Query Editor.

2. Create the Parameters ​

In Power Query, select Home → Manage Parameters → New Parameter and create ContinualBaseUrl, ContinualApiKey and ContinualUtcOffsetHours, exactly as in Power BI step 1.

3. Add the Queries ​

For each query in Power BI steps 2 to 4, select Home → New Source → Other Sources → Blank Query, then Home → Advanced Editor, paste the code, and rename the query to the name given:

  • Helpers: ContinualGet, ContinualSummary, ContinualLocalMidnight, ContinualTimestamp
  • Labels: Lines
  • Tiles: DueNow, OverdueNow, MissedToday, CompletionByDay, OpenActions

When Excel asks how to connect to https://api.continualapp.com/public/v1, choose Anonymous and select Connect. The key travels in the Authorization header the queries send. If Excel asks about privacy levels, choose Organizational for this source.

4. Label the Lines ​

The tile queries return line IDs. Add the line name to each one before loading. For example, for DueNow:

  1. Select the DueNow query, then Home → Merge Queries.
  2. Choose Lines as the second table. Select line_id in DueNow and id in Lines. Keep Left Outer and select OK.
  3. Expand the new Lines column and tick only name.

Repeat for OverdueNow, MissedToday and OpenActions.

5. Load to the Workbook ​

Select Home → Close & Load To…. For the helper queries and Lines, choose Only Create Connection. For each tile query, choose Table on a new worksheet.

Then build the tiles from the loaded tables:

TileBuild
Due and overdue checksA clustered bar chart of count by line name from DueNow, OverdueNow and MissedToday, or single cells with =SUM(DueNow[count]) and =SUM(OverdueNow[count]).
Completed against scheduledA line chart of CompletionByDay, with due_date as the axis and completion_rate as the values.
Open actionsA PivotTable from OpenActions, with line names as rows, category as columns and the sum of count as values.

completion_rate is already a daily percentage, so don't sum it across days. For one rate over the period, add a query without group_by, rather than averaging the daily rates.

6. Refresh ​

  • Select Data → Refresh All to refresh by hand.
  • To refresh automatically, open Data → Queries & Connections, right-click each tile query, choose Properties, and tick Refresh every n minutes and Refresh data when opening the file. Every 5 minutes or longer is plenty.

Each refresh makes about five requests, which is well within the rate limits.

Troubleshooting ​

See the Power BI troubleshooting table: the errors and their causes are the same. If Excel keeps asking for credentials, open Data → Get Data → Data Source Settings, select the Continual source, choose Edit Permissions, and set the credential to Anonymous.