Exploring Strava with PowerBI

Working with PowerBI quite a lot in the past months, I came through the idea of drilling my Strava data using PowerBI to build some dashboard out it. Got the idea some months ago, but didn’t have time to work on it. The last races of the season being cancelled, and as I am taking a few weeks of rest, I decided to have a look in detail. Here are my findings.

While it may look a good idea and pretty easy, having a quick look changed my mind. Despite Strava having a REST API, there is no easy way to get the data into PowerBI as it requires OAuth to authenticate before.

2 options there :

First one, to adapt a custom query I build to feed Graph API data into PowerBI by embedding access token management in the query (more on this later on). While this should be possible with Strava, it would take some time to adapt it

Second one, to reuse the custom connector built by Kasper de Jonge. I choose the latest, hoping that it would be up to date and easy enough to build.

Let’s start by downloading and installing Visual Studio. Note that the community version is enough for the task at hand

Next, let’s install it and make sure to install the .NET desktop development workload

Once you’re done with it, clone the connector repository from GitHub

Connect onto Strava and register a application by connecting to https://www.strava.com/settings/api

Grab the Client ID and the Client Secret

Go back in Visual Studio and create the 2 missing empty files client_id and client_secret

In the client_id file, just copy your client ID you get from Strava

In the client_secret file, just copy you client secret you get from Strava

Build the solution and you’re done. If you browse your project folder, you will find a Strava.mez extension available

Make sure you have the latest version of PowerBI installed, and copy the Strava.mez file to “C:\Users\YOURUSERNAME\Documents\Power BI Desktop\Custom Connectors”

Start PowerBI and check the options to make sure that custom connectors can be loaded by checking the option in Options – Security

Try to get some data to check if the Strava connector is available and you can play with your data !

Notes : few caveats I found using the connector and the Strava API

Access is limited by Strava to your OWN activities so don’t loose time trying to get other ones. To do, you need to build an application and have the other athletes authorize the application

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.