2. ● Quandl is a great source for financial data and has plenty of
free data that can be used for testing
(https://www.quandl.com/)
● How should I get the data from Quandl ? Don’t download it!
Rather use an API
● Quandl provides an API for Excel, Python and R.
● This post describes how to get data from Quandl into
PowerBI using the R API
2
Overview
3. 3
Register
Register, it is free
https://www.quandl.com/
Get API Key
Find your API key in the account
settings and profile section.
You need the API key for the R
Script
Note I have greyed out my API Key
for this post
4. 4
Install R and RStudio
Install R
https://cran.r-project.org/bin/windows/base/
Install RStudio
https://www.rstudio.com/products/rstudio/download/
● Download the free desktop version
● Follow the prompts
5. 5
PowerBI R Script settings
● You need to enable the R Script settings in PowerBI
● Go to Options > R Script
● For the 1st option browse to the folder where R is installed
● For the 2nd option PowerBI should pickup R Studio automatically
Resource
https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals
7. R Studio Test Script
Use R Studio to test your script to connect to Quandl
● Quandl has extensive resources on the R Script needed
(https://docs.quandl.com/docs/r-installation)
● Basically you
○ Install the Quandl Package - install.packages(“Quandl”)
○ Load the Quandl Library in your workspace - library(Quandl)
● Now you are ready to connect to a Quandl data set
7
8. R Studio Quandl Dataset
For this example I am using the AUD USD rates published by the Perth Mint
https://www.quandl.com/data/PERTH/AUD_USD_D-Exchange-Rates-AUD-vs-USD-
Daily
● Click on the R Library in Quandl and it would give you the script including you API
Key
● Use the script to test in R Studio
8
9. R Studio Quandl Dataset
● I have run the script below in R Studio, assigned it to a variable AUD_USD and
printed the header of AUD_USD
● Now I know the connection to Quandl and the dataset works.
● Now I want to do the same in PowerBI
9
10. PowerBI Quandl Data
● Go to Get Data > Other > R Script
● You can copy and paste the R Script you used in R Studio into PowerBI
● You need to make one change to the install.packages() script. Add the CRAN url
in the repos argument (“http://cran.us.r-project.org”)
10
11. 11
Ta-dah!
A direct connection to a
dataset on Quandl
PowerBI will create the
connection and load the data
You can edit the query and
the data as you normally
would in the query editor
12. Thanks!
I am Johann Krugell
A practical guide to “Power-Up” your analysis
You can find me at @JohannKrugell@linkedin
12
13. Credits
Special thanks to all the people who made and
released these awesome resources for free:
● Presentation template by SlidesCarnival
● Photographs by Unsplash
13