November 6, 2019   Dashboards /

Power BI: News Dashboard

In this tutorial, I will walk you through creating your own Power BI News Dashboard, which visualizes news about any topic that might interest you. While most of us use Power BI to analyze our own data, the 'Get Data from Web' functionality makes it just as easy to analyze external data.

The possibilities are endless, from following your favorite sports team to following news about a competitor, news on tech topics, local news, etc.

Below is what the News Dashboard looks like for the topic 'Power BI'.

Power BI News Dashboard
Power BI News Dashboard

The source data comes from News API (https://newsapi.org/). News API provides 'breaking news headlines and articles from over 30 000 news sources and blogs'.

Register for an API key to retrieve the news articles

The API key is your login for accessing the news articles. News API proposes a plan called Developer which includes a free API key. You can review their website to ensure that this is the correct plan for you.

Head to https://newsapi.org/, then select Pricing at the top. If it's applicable to you, choose the Developer plan which is the free plan. 

News API Pricing for the Power BI News Dashboard
News API Pricing

After registering, you will receive an email with your API key.

News API registration complete
News API registration complete

With the API key, we are ready to start creating our News Dashboard!

Load the data for the Power BI News Dashboard

In Power BI, click on Get Data and choose Web.

Get data from Web in Power BI
Get data from Web in Power BI

In the menu that appears, choose Advanced and fill it in as below.

URL parts:
https://newsapi.org/v2/everything?
q=power%20bi
&pageSize=100
&language=en

HTTP request header parameters:
X-Api-Key enter-here-your-API-key

Once filled, it looks like this.

Get Data from Web prompt
Get Data from Web prompt

Here is the explanation of what we filled in. 

For the URL parts, the first line is the website address and never changes. 

The second line is used for the search query. In the example, I search for Power BI, but you can search for anything you wish (local and global news, other tech topics, sports team, companies, etc). If your search phrase has more than one word, the words should be separated by '%20'.

The third and fourth lines are optional, they set the number of results received and the language of the articles. News API limits the maximum of results received to 100, so if you want to receive more results you need to create more queries.

If you are interested in checking out all available options for the articles search, you can check the page here.

Once you click on ok, you will see the result of the data load.

Prepare the data for the Power BI News dashboard

The result tells us that there are 891 articles for our search, however, only 100 are downloaded as this is the limit set by News API.

Articles search result for the Power BI News Dashboard
Articles search result

To open the articles, click on List.

Articles search result expanded
Articles search result expanded

Afterward, click on Convert to table.

Convert to table in Power BI
Convert to table

When the prompt appears, choose Ok.

Convert to table prompt
Convert to table prompt

Now choose the Expand button at the top right of Column 1, unselect 'Use original column name as prefix' and click OK.

Expand the articles
Expand the articles' columns

And we finally see all of our articles!

List of articles for the Power BI News Dashboard
List of articles for the Power BI News Dashboard

There is one more column to expand for the source of our articles (the news site or blog site where the article is from). For that, repeat the same step as above by clicking at the top right of the source column.

Expand the source column to see the articles
Expand the source column to see the articles' source

Before leaving Query Editor, we need to change the format of the publishedAt column to Date/Time. This will allow us to use this information in the dashboard.

Right-click on publishedAt and choose Change Type, then Date/Time.

Change the type of published date to Date/Time
Change the type of published date to Date/Time

We are almost ready to create the visualizations. 

Before that, we need to create two additional columns: one column with the Date only (instead of Date and Time as in the source data) and another column to correctly sort the dates.

Click on Modeling, then New Column.

New calculated column in Power BI
New calculated column in Power BI

Here are the two formulas:

publishedDate = FORMAT([publishedAt],"mmm-dd")

publishedDate order = FORMAT([publishedAt],"yyyymmdd")

After the two new columns are created, click on publishedDate and Sort it by publishedDate order.

Sort the published date
Sort the published date

We are now all ready to create the visualizations!

Create the visualizations for the Power BI News Dashboard

First visualization: timeframe slicer

The first element of the dashboard is a slicer for choosing the timeframe. This is a standard Power BI slicer with the measure publishedAt that we just created.

First visualization for Power BI News Dashboard: choose the timeframe
First visualization: choose the timeframe

Second element: number of articles by date

The second element is a Power BI line chart, with publishedDate in Axis and count of title in Values.

Second element for Power BI News Dashboard: number of articles by date
Second element: number of articles by date

Third visualization: Word Cloud

The third visualization is a Word Cloud, showing the most recurring words in the articles. The bigger the word is in the word cloud, the more recurring it is in the articles. The great part of this visualization is that words can be selected, and the news articles are automatically filtered based on these words.

Third visualization for Power BI News Dashboard: a Word Cloud
Third visualization: a Word Cloud

This is not a standard Power BI chart so it should be imported from the marketplace. Click on the three dots at the bottom right of the visualizations, and choose 'Import from marketplace'.

Import a visualization from the marketplace in Power BI
Import a visualization from the marketplace in Power BI

You find it by searching for Word Cloud, and you add with the button next to it.

Add the Word Cloud visualization
Add the Word Cloud visualization

Configure it by entering 'description' for Category and 'name' for Excludes. 

Configure the Word Cloud
Configure the Word Cloud

At the same time, ensure that Stop Words is On. This removes all articles such as 'The', 'A' from the word cloud.

Remove Stop Words from the Word Cloud
Remove Stop Words from the Word Cloud

Final element: list of articles

Now we add the last visualization: the list of articles.

Last visualization: list of articles
Last visualization: list of articles

This is a table chart with multiple columns. It has two 'special' columns, which are the image column with the article image, and the url column with a link to the article.

To correctly show the image and the link, we need to configure these two columns.

Click on image URL, then go to Modeling and choose Data Category: Image URL.

Data Category: Image URL
Data Category: Image URL

For URL, do the same but choose Data Category: Web URL.

You are done. Congratulations on creating your own News Dashboard!
I hope you found this useful.

Enjoyed the article? Subscribe to the newsletter and download the Power BI of the article for free.

    Share this post

    AUTHORLuca
    I help SMEs who want to get a clear view on what drives their profit. After becoming a CPA and 10 years in Corporate Finance between the US, Europe, and Asia I discovered my real passion. I love helping Small and Medium Companies figure out how to improve their profit and be sustainable.

    Join the discussion

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    LN Consulting
    Tired Of Building A Dashboard By Yourself?

    Continue Reading...

    May 2, 2022
    In this tutorial, I will teach you how to run a Basket Analysis in Power BI.  The Basket Analysis uncovers the products bought together by consumers. In the context of a grocery store, for example, this analysis might show that whipped cream and berries are frequently bought together.  Based on this result, you can:– place ...
    Read More
    May 2, 2022
    In this post, I will teach you how to build a Pareto analysis dashboard in Power BI. Specifically, the Pareto principle states that 20% of the causes generate 80% of the effects, and vice-versa. We can apply this empirical principle to different topics, from work (20% of the efforts cause 80% of the results) to ...
    Read More
    November 1, 2019
    In this article, I will guide you through creating your own Power BI dashboard for tracking tickets. While seemingly mundane, tracking tickets is key to the success of the customer service and IT department and impacts the success of a company. If you are looking for an in-depth review of the KPIs for your customer ...
    Read More