Facebook, we have a problem

Facebook is facing great challenges lately here. The latest privacy scandal, involving Trump campaign consultants who allegedly stole data on 50 million users in order to influence elections, is yet another crisis following very tough two years that may have shook its foundation.

To protect their users, and avoid misuse of user information, Facebook have made some changes to their API as of February 5, 2018, to prevent future exploits by app developers. As a result, if you rely on Power BI Facebook connector to analyze pages engagement, you will find some crucial breaking changes (Though, as you can see below, DataChant reports are fully functional. Do Facebook users react to the latest news on Facebook own Facebook page?)

For an example, here is a report that I have created in January, 2018 – before Facebook made the change. In this report, I was able “profile” top commenters, based on their user IDs.

In this article, we will review the changes, and explain your options, assuming you need to deliver Facebook reports using Power BI.

Before we do


Post Likes, and Identity of Commenters

According to Facebook here, Apps without a valid authentication token for a Page will no longer have access to the User node through the API. The apps without valid authentication may still pull comment threads and other engagement actions from third-party Pages, but userIDs and names will not be available through the API.

How does it affect you?

The Facebook connector in Power BI and Power Query (Get & Transform) in Excel, performs a user-based authentication. If in the future, the Power BI team will support page authentication, you will still only be able to extract UserIds of pages that you own, or receive permissions from their admin to read insights.

OK, but I am not interested in user IDs, can I import the number of likes per post?

The good news is that this is doable, using the Web connector and advanced M and Facebook Graph APIs. While I am not able to share it here, you are welcome to contact me and learn more. You can purchase my solution here, or get a one-time report on any page you are looking for. In addition to user likes, you can also import the user reactions, and gain insights into user sentiment, and detect social media backlash on any brand with a Facebook page.

Here is an example of my report (You can see that user likes and reactions are analyzed). The entire code is based on M in Power Query. Explore the pages of this report, to find the audience reaction to Wells Fargo since January 2016:

By the way, the report above includes also sentiment analysis and key phrase extraction, using Microsoft Cognitive Services.

Come on! I don’t have a budget to buy your stuff. I want it FREE!

I am sorry. This time I cannot help. On a second thought, let me help. At least partially. Instead of relying on Facebook likes to measure the user engagement in Power BI, you can use the Facebook connector to measure the number of shares per post. And you can do it on ANY Facebook page. Here is the M function you can use:

= Facebook.Graph("https://graph.facebook.com/v2.11/[Facebook page ID or object name here]/feed?limit=100&fields=from,message,created_time,shares")

For learning purposes only (read the terms of use, please), you can purchase this report with the full M code, and use it on many pages. I have dedicated a chapter in my new book here, that will cover this scenario as well.

Page Insights:

As of February 5, 2018, all page insights metrics require a page access token of the page of which the insights are being queried. To access such data someone needs to grant you the read_insights permission. Once granted, you can retrieve metrics for all pages owned by this person. If you are not the admin of a Page, you can still read insights about a Page as long as you have a Page Access Token. Unfortunately, the Facebook connector used by Power BI / Power Query in Excel is based on a user access token.

Possible Workaround:

For ad-hoc analysis purposes, you can use the Web connector, with an external page access token, that you can extract from external tools such as the Facebook Graph API console. Stay tuned for more.



  1. ielison Reply

    Hi, Gil. First of all, thank you for the explanations. I’ve been out for a while without working with data analysis on Facebook Pages. Now that I’ve tried to extract some information from competing pages, I realized that the reactions were not appearing in Power BI. Your page was the only one where I found some kind of explanation. I even tried to create an app as a developer on Facebook and from what I understand I do not have authorization to access this type of information (reactions). Is that correct?
    I understand it’s also necessary to show exactly how the app would use this type of information and record a video of the application. My knowledge as a programmer is limited, although I’m willing to continue to develop the app. Is it really necessary to create this complete environment? Can you give me some kind of advice about it?
    Thank you very much anyway.
    Greetings from Brazil

Leave a Reply