You are on page 1of 12

03 Data Import -

Connecting To Data Sources


Chris Webb
chris@crossjoin.co.uk
Agenda
• Importing data, live connections and DirectQuery in Power BI Desktop
• Power BI Desktop and Power Query
• Data sources for importing data in Power BI Desktop
• Locale
• Authentication
• Configurable options
• Connecting to data in PowerBI.com
Data Sources For Power BI Desktop
• Power BI Desktop can connect to data sources in three ways:
• You can copy data from a data source and store it inside Power BI’s
own native database engine
• You can store data externally in SQL Server Analysis Services
• Basically the same engine as used in Power BI Desktop
• Doing this stops you doing any modelling work in Power BI Desktop
• You can create DirectQuery connections to some data sources
• You model the data in Power BI but do not import it
• Every time you run a query, Power BI generates SQL to get the data it needs
Pros/Cons Of Importing Data
• Importing data into Power BI is the option you are likely to use most
• Benefits:
• Fast query performance
• All your import, modelling and report design work is in one place
• Access to all the latest language and engine improvements
• Disadvantages:
• Max model size in PowerBI.com is 1GB after compression (250MB from Excel)
• Data import can be slow
• Data needs to be refreshed to stay up-to-date
• Difficult to share import/modelling work between multiple Power BI files
Pros/Cons Of Live Connections To SSAS
• Benefits:
• You can partition tables and only refresh data that has changed
• You are only limited by the memory available on your server
• Better security options
• Takes modelling decisions away from end users
• Disadvantages:
• Expensive: needs high-spec server, SQL Server Enterprise or BI Edition licence, skilled
developers and administrators
• Takes time to create a single model
• Potential latency issues between Power BI and SSAS server
• Takes modelling decisions away from end users
• Latest features only available in SQL Server 2016
Pros/Cons Of DirectQuery
• Benefits:
• Data is always up-to-date, no need to refresh it
• No data is stored in Power BI (except for caching)
• Allows you to work with the largest data volumes
• Disadvantages:
• Worst query performance
• Tuning your data source will take the most work
• Limited data transformation and modelling capabilities
• Frequent data changes can be confusing for end users
Power BI Desktop And Power Query
• The data import experience in Power BI is basically the same as that
provided by Power Query in Excel
• Differences in Power Query:
• The presence of the Excel worksheet as a data source to allow for user
interaction
• More flexibility in code at the advanced level
• Power Query can load data to a table in the worksheet as well as loading data
direct to the Excel Data Model
Data Sources In Power BI Desktop
• Relational databases: SQL Server, Oracle, Access, any ODBC
• Azure databases and services
• Files: text, csv, XML, JSON, Excel
• Web pages and web services
• OData feeds
• Enter your own data in a freeform grid
• Import data using an R language script
• Others including SharePoint Lists, SalesForce, Facebook, Exchange Online,
Dynamics CRM
• Data sources in Preview mode will need to be enabled on the Option dialog
Locale
• Different locales use different formats for dates, thousands
separators and decimal separators
• By default Power BI Desktop will assume that data sources use the
same locale as your operating system
• You can change the locale used in the Data Load tab of the Options
dialog
• You can also set a locale to use for an individual text or csv file
Authentication
• Power BI Desktop stores credentials used to connect to data sources
in its own data store
• Credentials are not stored inside the Power BI file
• Therefore if your Power BI file is opened on another PC you may
need to re-enter credentials
• Credentials can be edited and/or deleted in the Data Source Settings
dialog
Configurable Options
• There are various useful configurable options that can be set on the
Options dialog
• Turn on/off auto-detection of data types and headers for
unstructured sources
• Relationships:
• Import relationships from data sources that have them
• Update relationships when refreshing data
• Auto-detect relationships from data when none exist
• Allow background loading of data previews (may use lots of
memory/CPU for some sources)
Data Sources In PowerBI.com
• When working in PowerBI.com you have slightly different options for
the data sources you can connect to
• You can connect to cloud-based databases and services like Azure SQL
Database and Azure SQL Data Warehouse with DirectQuery
• You can use organisational content packs that your colleagues have
created to connect to your organisation’s data sources
• You can use content packs for services to connect to third party cloud
service providers like Google Analytics, MailChimp and GitHub
• You can push data into PowerBI.com programmatically via the API

You might also like