Skip to main content

Use Wikipedia As A Data Source To Prepare Power BI Report

Overview
Power BI is a business intelligence tool that supports so many data sources to prepare a report. As we all know, Wikipedia is a very good resource of useful information, and we can consume Wikipedia data as a data source and prepare a Power BI report.
Example
In this example, we will prepare a report of the largest selling pharma products. We will use the following URL as a Data Source -
https://en.wikipedia.org/wiki/List_of_largest_selling_pharmaceutical_products
If we open the above link, it will show the analytical data for selling  a pharma product.
Note - Make sure of one thing - If we want to use Wikipedia as a data source, its information must be stored in a tabular manner. Only then can we consume its data in Power BI.
Now, let’s get stated!
Step 1
Open Power BI Desktop and click on Get Data.
 
Step 2
Select Other Services > Web as a data source. Then, click "Connect".
 
Step 3
It will ask you to enter the URL. Post the URL as following-
https://en.wikipedia.org/wiki/List_of_largest_selling_pharmaceutical_products
 
 
Step 4
It will show all available tables from Wikipedia. We will select both the tables. Now, click "Load".
 
Step 5
The below screen shows two tables loaded in Power BI.
 
Step 6
Now, we will rename our tables. Double click the name of an old table and rename it. We will rename our tables as “Top 10 Company” and “Pharma Company” respectively.
 
We will also rename one column as "Sales" by clicking on it.
 
Step 7
We can also check if our data is loaded properly or not using Data tab on the left side.
The below screenshot shows the data from both the tables.
 
 
Step 8
Now, it’s time to add visuals. We will add one “Table" visual and one “Staked bar chart” visual.
Properties for both the visuals are in below screenshot.
  1. Table Visual


    This visual shows the following columns.
    o Brand
    o Company
    o Rank
    o Sales
  2. Staked bar chart visual
    This visual shows the sales report data with respect to the company name.
 
Step 9
Now, we will apply some formatting on our visuals so as to make them more attractive.
 
I have formatted the visuals. Below is a screenshot of both the visuals after formatting.
 
Step 10
Now, let's filter our report based on the company name. From bar chart, click on any company.
It will filter the data based on company name in a table.
 
Conclusion
This is how we can prepare a Power BI Report consuming Wikipedia as a Data Source.
I hope you love this article.

Comments

Popular posts from this blog

How to partition or split DataTable in C#?

Today we will discuss how we can divide or split a very large data table into fixed size of chunks? Scenario: Suppose there is a data table which has 1000 Rows. When you perform for each loop on data table and read each row at that time it will take too much time. If we devide 1000 Rows datatable into 10 fixed sizes (e.g. 100 Rows) datatable, It will take less time. Let's check how to achieve it. Here is a code. private static List<DataTable> SplitTable(DataTable originalTable, int batchSize) { List<DataTable> tables = new List<DataTable>(); int i = 0; int j = 1; DataTable newDt = originalTable.Clone(); newDt.TableName = "Table_" + j; newDt.Clear(); foreach (DataRow row in originalTable.Rows) { DataRow newRow = newDt.NewRow(); newRow.ItemArray = row.ItemArray; newDt.Rows.Add(newRow); i++; if (i == batchSize) ...

How To Lock Objects In Power BI

Overview Sometimes, there is a situation where when we open a report and click on any visual it accidentally nudges a chart a little bit to the right or left. Sometimes, by mistake when viewing a report, the arrangement of visuals scatters a little bit. Microsoft rolls out one new amazing feature to resolve this issue, that is, Lock Objects in Power BI. Advantages of using this feature When our purpose is to only view a report, this feature is a boon for us. Visualization’s position is not changed. Saves a lot of the developer's time to resolve the position related issues. Note   -  This feature is not saved with the report. So, every time you open a report, you need to enable this feature. Now, let’s understand this feature in a brief manner. To understand this, I will first show you one report in which I have not enabled “Lock Objects” feature. Step 1 The below screenshot shows my report which doesn’t have the enabled Lock Objects feature. ...

Use SharePoint Online List As A Data Source In Power BI

Introduction In this article, we will check how we can use SharePoint List as a data source in Microsoft Power BI. Please follow the below steps to establish the connection of SharePoint Online list with Power BI.  Step 1 Open Power BI Desktop > Get Data > Click More.   Step 2 Search for SharePoint > SharePoint Online List.   Step 3 Enter the URL of your SharePoint site.   Step 4 Click on Organizational account > Sign In.   Step 5 It will open the screen of Office 365 Login > Enter Credentials.   Step 6 Click on Connect.   Step 7 It will show all the lists available in the SharePoint - lists are on the left corner and their preview is on the right. Select all the lists which you want to use directly in the Power BI. Click on Load.   Step 8 It will load all the lists. Expand "Fields" column to view all the fields shown in the SharePoint List.   We can also view all the...