Database Based Reports

Instead of importing spreadsheets, many Power BI reports connect directly to a database such as SQL Server, MySQL, or PostgreSQL for a single source of truth.

Connecting to a Database

Get Data -> Database -> choose engine -> enter server and database name -> Import or DirectQuery -> Load

Import vs DirectQuery Recap

  • Import - copies data into Power BI's in-memory engine; fastest performance, needs scheduled refresh.
  • DirectQuery - queries the live database on every interaction; always current, but limited by the source's speed.

Native Queries

Advanced users can write a custom SQL statement directly in the connection dialog to pull a pre-shaped result set instead of an entire table.

Refresh and Security

  • Scheduled refresh - keeps imported data up to date on a set schedule once published to the Power BI Service.
  • Row-Level Security (RLS) - restricts which rows a given user can see, enforced consistently whether the report uses Import or DirectQuery.
DirectQuery is a great fit for very large or fast-changing databases, but every filter and slicer click sends a new query to the source - so report design and database indexing both matter a lot more than with imported data.

Ready to Master Data Science?

Join Uncodemy's Data Science Course and build real, job-ready skills with expert mentors.

Explore Course