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.

Power BI Master/Detail Report from live SharePoint data

In the real-world, reporting often includes master/detail scenario in which a master list item is selected in order to get more details about the entity. In SharePoint, master data will be stored in a list that contains a lookup column of detail list/s, and getting data from multiple lists would require multiple data sources and then modelling their relationships in Power BI. In this blog, I will show you how easy it is to achieve a master-detail scenario on live data coming from SharePoint lists using AxioWorks SQList. We will start off by looking at the lists which we are going to use in this scenario and followed by how we can use SQList to synchronise data between SharePoint Lists and SQL Server database and to finish things off, we will look at how to generate a report which shows master data in one table and details in the other based on a selection.

Scenario

Create an orders report in Power BI showing the current orders in one table and order details in the other based on selection.

SharePoint Lists

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

Invoices list

  • This list contains all the orders data.
  • Columns
    • Title (Single Line of Text)
    • Customer  (Lookup)
    • Total Amount (Money)
    • Product IDs (lookup column linked to product list).

Customer List

  • It is a custom list that contains the data of the customer.
  • Columns
    • Title (Single Line of Text)
    • Address (Address of customer)

Product list

  • This list contains all the product 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 that 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 that 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 “AxioWorksInvoices”.

Step-2: Replicate and Synchronise data to Database

Secondly, we need to replicate the data from SharePoint lists into the 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.

  • The 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. Invoices, Customer, Product, Category, and Category Group.

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

  • The 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 synchronising 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.

  • The next step is to create a SQL view which will be used as a data source in the Power BI for fetching the data. We will use SQL View Designer to generate for defining the relationships between all the selected tables and then generating the view.

Step-3: Generate a report in Power BI

  • Let’s open up Power BI.
  • Create a Connection to the SQL database and then select the view we created earlier as a data source.

  • Right-click on the data source and click on the edit query which will open up the advanced query designer.
  • Use Group by to group the invoice data which will act as master data by selecting the invoice columns.

  • Once the data is grouped by invoice detail, expand the product information details by selecting the product-related columns.

  • Now our data source is ready to be used in the report.
  • Add two tables on the report page, First table will serve as a master table with invoice information.

  • The second table will serve as detail table with product information including all the products in the selected invoice.

  • To test it out select an invoice in the invoice table, the details related to the invoice will be displayed in the products table.

Conclusion

To summarise, today we saw how easy it is to generate a Power BI master and detail report using data from SharePoint lists if we use a SQL database and SQL View as a data source that has data replicated and synchronised using SQList so the report reflects live data from SharePoint.

Want to know more?

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

For information, contact us at info@axioworks.com

Latest articles

What went down at MS Ignite 2021: Power Automate and Power Virtual Agent Edition

14 Jan 2022

When we talk about the biggest annual tech conferences of the year, Microsoft Ignite comes to mind where not only do we get a view of all their […]
[read article]

What went down in MS Ignite 2021 : Power Apps Edition

30 Dec 2021

When we talk about the biggest annual tech conferences of the year, Microsoft Ignite comes to mind where not only do we get a view of all their […]
[read article]

AxioWorks Newsletter December 2021: How has 2021 been for you?

28 Dec 2021

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

AxioWorks Newsletter November 2021: What has AxioWorks been up to?

03 Dec 2021

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

What went down in MS Ignite 2021 : Power BI Edition

30 Nov 2021

When we talk about the biggest annual tech conferences of the year, Microsoft Ignite comes to mind where not only we get a view of all their product […]
[read article]

AxioWorks Newsletter October 2021: Focus on customer service and a webinar on its way

01 Nov 2021

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

Gain valueable Insights into your PowerApps using Application Insights

25 Oct 2021

Power Platform provides a great way for citizen developers to develop Apps using low-code /no-code tools like PowerApps, PowerAutomate, and PowerBI. […]
[read article]

AxioWorks Newsletter September 2021: Focus on our sales effort

18 Oct 2021

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

Why use SQList to generate Power BI reports from SharePoint lists, rather than using the Power BI native connector to SharePoint?

18 Oct 2021

The main reason is that in practical terms using the native connector only works for small amount of data and simple queries. When you start using it […]
[read article]

SharePoint Online List vs SQL Server as Data Source in Power-BI

15 Sep 2021

Lists are primarily used as a source of data storage in the world of SharePoint and in most scenarios these lists can grow really fast especially if […]
[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

*