Unlock the Power of Automation: Seamless Integration of SQL Server with Power Automate in Power BI — Part 2

Onyeaghala Victor
6 min readMay 12, 2023

--

Trust you’ve been having an interesting journey in this automation process from SQL Server to Power Automate. Now let’s continue this interesting journey. If you are just joining us, please read the first article before you proceed. Let’s jump in then.

4. Connecting SQL Server to Power BI

Once you have set up the automated process in SQL Server Management Studio (SSMS) to extract and save data from SQL Server, the next step is to establish a connection between SQL Server and Power BI. This connection allows you to leverage the extracted data for visualization, analysis, and reporting purposes. Follow the steps below to connect SQL Server to Power BI.

a. Launch Power BI Desktop

Start by launching Power BI Desktop, the primary tool for creating data visualizations and building reports in Power BI.

  • Open Power BI Desktop on your machine. If you don’t have it installed, you can download it from the Microsoft website.

b. Get Data from SQL Server

In Power BI Desktop, you need to import the data from SQL Server into your Power BI project.

Click here to see the summarized step on how to import data from multiple sources into Power BI

  • Click on the “Get Data” button on the Home tab in Power BI Desktop.
  • In the “Get Data” window, select “SQL Server” from the list of available data sources.
  • Enter the server name and credentials to establish a connection with your SQL Server instance.
  • Select the specific database or tables from which you want to import data into Power BI.
  • Optionally, you can specify a SQL query to retrieve customized data or apply filters to limit the data imported.
  • Click “Load” to import the data into Power BI.

c. Configure Data Load and Transformation Options

Once the data is imported into Power BI, you can configure various options to refine and shape the data for your analysis.

· Use the Power Query Editor, accessible by clicking on “Edit Queries” in the Home tab, to perform data transformations, such as removing columns, renaming fields, or applying filters.

· Apply data cleaning operations, such as handling missing values, removing duplicates, or modifying data types.

· Use the query editor’s capabilities to merge tables, create calculated columns, or define relationships between tables, if required.

d. Build Visualizations and Reports

With the data from SQL Server loaded into Power BI, you can now create powerful visualizations and reports to gain insights from your data.

I explained this in my Introductory Article to Power BI

  • Navigate to the Report view in Power BI Desktop.
  • Select the appropriate visualizations, such as charts, tables, or maps, from the Visualizations pane.
  • Drag and drop fields from the data pane onto the visualizations to populate them with data.
  • Customize the visualizations by applying filters, adding calculated measures, or adjusting formatting options.
  • Create multiple visualizations to represent different aspects of your data and build interactive dashboards.

e. Publish and Share the Power BI Report

Once you have designed your visualizations and reports in Power BI Desktop, you can publish and share them with others for collaboration and access.

  • Click on the “Publish” button in the Home tab of Power BI Desktop.
  • Sign in to your Power BI account to upload the report to the Power BI service.
  • Specify the workspace and report name for the published report.
  • Once published, you can share the report with specific individuals or groups, enabling them to view and interact with the data.

By following these steps, you have successfully connected SQL Server to Power BI and imported data from SQL Server into Power BI Desktop. You can now explore, analyze, and visualize the data using the powerful capabilities of Power BI. In the next step, we will explore the process of creating sample visuals on Power BI to enhance data representation and analysis.

5. Creating Sample Visuals on Power BI

After connecting SQL Server to Power BI and importing the data into Power BI Desktop, the next step is to create sample visuals to visualize and analyze the data. If you are a total beginner, this is a good step-by-step guide to creating a good visual.

Alternatively, you could quickly jump in and read my article on a comprehensive guide to Power BI dashboard and customization. So we don’t stop your flow, let’s just go ahead and make things fast.

In the next step, we will explore how the refresh button in Power BI indicates changes in SQL Server, allowing you to keep your visualizations up-to-date.

6. How the Refresh Button on Power BI Indicates Changes in SQL Server

One of the key advantages of connecting SQL Server to Power BI is the ability to keep your visualizations up-to-date with the latest data from SQL Server. The refresh button in Power BI allows you to update your data and reflect any changes that have occurred in SQL Server. Follow the steps below to understand how the refresh button works in Power BI.

a. Understanding Data Refresh

Data refresh is the process of updating the data in your Power BI reports and dashboards to reflect any changes made in the underlying data sources. When you import data from SQL Server into Power BI, it creates a connection between the two. By default, Power BI automatically refreshes the data based on the defined refresh settings.

b. Accessing the Refresh Options

To configure and manage the data refresh settings in Power BI, follow these steps:

  • Open your Power BI report in Power BI Desktop.
  • Click on the “Home” tab in the ribbon.
  • Locate the “Refresh” button in the toolbar.

c. Configuring Refresh Options

Clicking on the “Refresh” button opens the data refresh options window, where you can define the refresh behavior. You have several options to choose from:

  • Refresh Now: This option triggers an immediate refresh of the data in your report. Power BI queries the SQL Server database and updates the visuals with the latest data.
  • Scheduled Refresh: Power BI allows you to schedule periodic data refreshes. You can specify the refresh frequency, such as daily, weekly, or custom intervals.
  • Refresh Settings: Within the refresh settings, you can configure additional options such as refreshing data when the report is opened, refreshing data in the background, or refreshing data for specific tables or queries.

d. Monitoring Refresh Status

Once you have configured the data refresh options, you can monitor the refresh status to ensure that the process is executing successfully. Power BI provides a refresh history and status panel that displays information about the last refresh, including the start time, duration, and any errors encountered.

e. Handling Refresh Failures

In some cases, data refresh can fail due to various reasons such as network issues, data source connectivity problems, or data transformation errors. When a refresh fails, Power BI displays an error message indicating the cause. You can troubleshoot the issue by reviewing the error details, checking your network connection, or adjusting the data transformation steps.

f. Notifications and Alerts

To stay informed about the refresh status and receive notifications when a refresh fails, Power BI offers various notification options. You can configure email notifications to be alerted when a refresh encounters an error. Additionally, you can set up alerts to receive notifications based on specific conditions, such as data thresholds or refresh failures.

By understanding how the refresh button works in Power BI, you can ensure that your visualizations are always up-to-date with the latest data from SQL Server. Regularly refreshing your data allows you to make informed decisions and keep your reports accurate and relevant.

In the next step, we will explore the introduction to Power Platform Automate and its role in the automated process from SQL Server to Power BI.

Click here to jump in

--

--

Onyeaghala Victor
Onyeaghala Victor

Written by Onyeaghala Victor

Data Analyst | Data Scientist | Speaker on Purpose and Influence