Tagged: dax

Analysing Football Data in Power BI

Two passions of mine that go hand in hand are sports and data. Fans nowadays can access a whole host of statistics for every sport imaginable. This data can be used for any number of reasons, including for gambling purposes and to help win fantasy leagues. Most premier sports teams now employ data analysts to look for something that will give them an edge and an advantage over their opponents. (On a related note, I’m currently reading Big Data Baseball by Travis Sawchik – a really interesting insight into how the Philadelphia Phillies used previously untapped data to improve their fortunes).

For the past year or so, I’ve been collecting, cleaning, transforming and analysing football results data, mainly for leagues in Scotland and England. I’ve been using a few of my favoured tools to do this – namely Power BI, PowerPivot and R. The ability to embed reports in a web page was added in a recent Power BI update, so I can now post an example of the kind of thing I’ve been building. Power Query is used to consume raw data from CSV files and scrape data from the web, then cleanse and shape it into a useable format. Relationships are then created in Power BI and I’ve added a set of useful measures and calculations using DAX. See below for my interactive Scottish Premiership report, with data going back to the 2000-2001 season.

This report currently allows a user to view league tables; to analyse shots, shots on target and goals; to view historical team matchups and to analyse monthly team form.

Please give it a go, have a play – any comments and suggestions are welcome. Let me know if you spot any errors! I’ll be adding more analysis to this over time, as well as adding in data from other leagues across Europe and lower league data.

Note: I’ve cross-posted this at my business blog over at FocusBI.co.uk.