Analyze Webpage Data Using Power BI Desktop

Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He is studying at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).
As a long-time soccer fan, you want to report on the UEFA European Championship (Euro Cup) winners over the years. With Power BI Desktop, you can import this data from a webpage into a report and create visualizations. This tutorial will guide you through the process of using Power BI Desktop to:
Connect to a web data source and navigate its available tables.
Shape and transform data in the Power Query Editor.
Name a query and import it into a Power BI Desktop report.
Create and customize a map and a pie chart visualization.
Connect to a Web Data Source
You can obtain the UEFA winners data from the Results table on the UEFA European Football Championship Wikipedia page: UEFA European Championship.
Note: Web connections require basic authentication. Websites needing authentication may not work properly with the Web connector.
Steps to Import Data:
In the Power BI Desktop Home ribbon, click the dropdown arrow next to Get Data, then select Web.
In the From Web dialog, paste the URL
https://en.wikipedia.org/wiki/UEFA_European_Football_Championshipinto the URL text box, then select OK.After connecting to the Wikipedia webpage, the Navigator dialog will show a list of available tables. Select Table 3 for the data you need and then select Transform Data to clean it up.
Note: The Preview pane shows the most recent table selected, but all selected tables will load into the Power Query Editor.
Shape Data in Power Query Editor
To make the data easier to scan, display only the years and the countries/regions that won:
Remove all columns except for two. Rename one of these columns as CountryRegion.
In the Power Query Editor, select the columns.
Press Ctrl to select multiple items.
Right-click and select Remove Other Columns.
Filter out unnecessary values in the Final column (e.g., exclude "Winners").
Select the filter dropdown on the column.
Clear the checkbox next to the Winners option and select OK.
Do the same for 2028 and 2032, as those outcomes are unknown.
Rename the second column to CountryRegion:
- Double-click on the header or right-click and select Rename.
Filter out rows with null values in the CountryRegion column by selecting Text Filters > Does not Equal.
Remove the superscript note marker [c] from the year 2020, or change it to 2021:
- Right-click on the column, select Replace Values, and enter the necessary values.
Import the Query into Report View
Now that you’ve shaped the data, name your query Euro Cup Winners and import it into your report:
In the Queries pane, enter Euro Cup Winners in the Name text box.
Select Close & Apply from the Home tab.
The query loads into the Power BI Desktop Report view, visible in the Data pane.
Tip: You can return to the Power Query Editor anytime to refine your query.
Create a Visualization
To visualize your data:
Select the CountryRegion field in the Data pane or drag it to the report canvas. Power BI Desktop will automatically create a Map visualization.
Enlarge the map to ensure all country/region names are visible.
To reflect how often each country/region has won, drag the Year field to Bubble size in the Visualizations pane. This will create larger data points for countries/regions with more wins.
Customize the Visualization
You can customize your visualizations easily:
Format the Map
With the visualization selected, click the Format (paintbrush) icon in the Visualizations pane.
Change colors for distinct data points, particularly for Germany and West Germany, and give the map a more descriptive title.
Change the Visualization Type
The Soviet Union no longer appears on modern maps.
To show all values accurately, consider changing the map to a pie chart:
- Select the map and choose the Pie chart icon in the Visualizations pane.
Tip: Use the Data colors formatting options to unify the colors for "Germany" and "West Germany".
Power BI Desktop provides a comprehensive experience, from data acquisition to visualization. Once your report is ready, you can upload it to Power BI and create shareable dashboards.