Updated on

SparkPost.GetTable is a Power Query M function that returns a table of available metrics from the SparkPost API v1.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


   DaysToAggregate as number,
   MetricColumns as text,
   NonMetricColumns as text,
   Path as text,
) as table


This function can be used to retrieve data from a particular “Metrics” endpoint of the SparkPost API v1. When refreshing these tables or making calls to the SparkPost API using this connector, keep in mind that the SparkPost API has a strict API rate limit. If you see a 429 status code being returned from the SparkPost server you have hit the rate limit and will need to wait a few moments before making more calls. When choosing a value for the Number of days parameter, note that the API only stores 6 months worth of data.


Retrieves count_sent and count_rejected deliverability metrics for all campaign_ids aggregated over the last three days.

// Output: table
Source = SparkPost.GetTable( 3, "count_sent,count_rejected", "campaign_id", "metrics/deliverability/campaign" )

Other functions related to SparkPost.GetTable are:

Contribute » | Contributors: Rick de Groot