Our use of cookies

We use cookies to tailor your experience, gather analytics, and provide you with live assitance. By clicking "Accept" or continuing to browse our site you agree to the use of cookies. For more details please read our Cookie Policy.

Generate Power BI Charts and Reports from live SharePoint list data

In this blog, I will show you the best way of creating a Power BI chart on live data coming from SharePoint lists. We will start off by looking at the lists which we are going to use for this demo and followed by how we can use SQList to synchronize data between SharePoint Lists and SQL Server database and to finish things off, we will look at how to generate our reports and charts much faster.

Scenario

Create a bar chart in Power BI showing the total price and total current stock of products by Category Group.

If you would rather watch a video, this tutorial is also available on our YouTube channel at: https://youtu.be/MY3Z0PDY1pA

SharePoint Lists

For this demo, we will use three custom lists with some data in SharePoint.

Product list

  • This list contains all the products data.
  • Columns
    • Title (Single Line of Text)
    • Unit Price (Money)
    • Current Stock (Number)
    • Category ID (lookup column linked to category list).

Category List

  • It is a custom list which contains data of all the product categories.
  • Columns
    • Title (Single Line of Text)
    • Category group ID (lookup column linked to Category groups list).

Category Group List

  • It is a custom list which contains data of all the product category groups.
  • Columns
    • Title (Single Line of Text)

Step-1: Create a Database in SQL Server

First off, we need a database that will be used for replicating the data coming from SharePoint lists.

  • Open SQL Server Management Studio and create a new database named “ProductsReportdemo”.

Step-2: Replicate and Synchronize data to Database

Secondly, we need to replicate the data from SharePoint lists into SQL Server database. We will use SQList to achieve that.

  • Open SQList Manager and click on “Create a new replication”.

  • Create a new SharePoint connection, enter the connection name and Table prefix
  • and select the SharePoint site which contains the lists and clicks next.

  • Next step is to select the replication lists, we will select the 3 lists which are going to be used for this exercise i.e. Product, Category and Category Group.

  • Next, enter the details for the destination SQL database connection which is the database we created earlier.

  • Last step is to give this replication a name, and keep the default options as checked and then click finish.
  • Once the replication is created, SQList replication service will start off for synchronizing the SharePoint lists and SQL database.
  • Once the service is started, you will see that some tables have been created in the destination database including the tables for the lists which we selected.

Note: SQList will keep the database in-sync with the SharePoint lists which means any updates made in the lists will be replicated in this database as well.

Step-3: Generate a Chart in Power BI

  • Let’s open up PowerBI.
  • First off, we need to get the three sql tables Product,Category & CategoryGroup into PowerBI data model.
  • Create a Connection to the demo database and then select the tables and then add them in the model using direct query.

  • Next step is to define the relationships between the tables. So, go to Manage relationships and then drag and drop the three tables tables.
  • In order to create a relationship, drag Category ID in Product table to ID in Category table and select the relationship type as Many to One (*:1)
  • Similarly, drag ID in CategoryGroup table to CategoryGroupID in Category table and select the relationship type as Many to One (*:1).

  • Now, the last thing to do is it to create a chart. We will use a simple bar chart.
  • For Label, we will select Title in CategoryGroup table.
  • For Values, we will select the sum of Unit price and Current Stock in Product table. This will generate the chart.

  • Now to test the synchronization, let’s go to SharePoint and add a new item in Products list. Lets add a product of Category “PC & Video Games” and enter 2000 as current stock. Once, you refresh the data in PowerBI Chart you will see that our chart has changed.

Bonus: Optimize your report using SQL View

We can also simplify this process and improve the performance at the same time by using a SQL View instead of the tables to generate the chart.

  • So, Lets go back to the SQL Database and create a view which includes the Product category title, Sum of UnitPrice and Sum of CurrentStock from Product.

  • Now, lets go back to the PowerBI and remove the tables from the relationship manager. Select the SQL database connection and select the view.

  • Again select the Bar chart and select the three fields in the view which will generate the same chart but only faster.

Conclusion

To summarize, today we saw how to generate a Power BI bar chart using SQL database tables which are in synch with SharePoint lists using SQList so the chart reflects live data from SharePoint. We also covered how to speed up the process by using SQL View instead of tables.

Want to know more?

To download a 30 day trial of AxioWorks SQList or book a demo, please visit: /sqlist/

Form information, contact us at info@axioworks.com

Latest articles

Why Support Legacy SharePoint Versions Like SharePoint 2010?

16 Nov 2023

In the fast-paced world of technology, where new versions and updates are continuously rolled out, a recurring question often arises: “Why […]
[read article]

Why Companies are choosing SQList over Power Automate

30 Oct 2023

In the realm of synchronisation services, AxioWorks’ SQList and Microsoft’s Power Automate (earlier known as PowerApps) have emerged as […]
[read article]

AxioWorks Newsletter October 2023: An exhilarating month.

28 Oct 2023

Hello Reader, As we step into the season of autumn, we are thrilled to share with you the latest developments and opportunities unfolding at […]
[read article]

Why Choose SQList for SharePoint Data Extraction Over DIY Solutions

16 Oct 2023

In the ever-evolving world of technology and data management, the question often arises: “Why should I use a product like #SQList when I can […]
[read article]

AxioWorks Newsletter September 2023: An exhilarating month.

30 Sep 2023

Hello Reader, September has been a bustling and exhilarating month for us at AxioWorks, filled with advancements, collaborations, and a whole lot of […]
[read article]

The Collaborative Pathway: Bridging Minds in the AI Ecosystem

19 Sep 2023

In recent days, I found myself immersed in an enlightening conversation with a friend, a fellow entrepreneur steering his ship in the vast sea of […]
[read article]

AxioWorks Newsletter August 2023: A month of milestones and innovation.

28 Aug 2023

Hello Reader, September seems to be a month of unexpected milestones and continued innovations at AxioWorks. As the summer wanes and the autumn […]
[read article]

Use Graph API in Power Automate to read large Excel files from SharePoint

28 Aug 2023

Power Automate, a part of Microsoft’s suite of tools, is increasingly becoming a preferred choice for automating workflows and business […]
[read article]

From Punch Cards to Python: Still Hitting the Keys in my 50s

16 Aug 2023

I spent the entire weekend writing code, not because of deadlines to meet or million-pound dreams, but for the kick that I still get from doing it. […]
[read article]

AxioWorks Newsletter July 2023: Unveiling AxioWorks’s latest successes and exciting innovations

27 Jul 2023

Hello Reader, We hope this monthly update finds you in good spirits. As always, we are eager to share the latest developments and exciting ventures […]
[read article]

Get SharePoint and SQL news to your inbox

Stay up-to-date with industry news and trends, SQL and SharePoint innovations and all the latest from AxioWorks by subscribing to our monthly newsletter.

Subscribe to the AxioWorks newsletter

*