Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Colin
Frequent Visitor

Facebook Page Likes

Hi everyone,

 

I am building a dashboard for my Company's marketing department. So far, I have been able to load all of the data related to our page's "Posts" using the Get Data wizard with Facebook as the source.

 

I cannot figure out how to pull the data of those accounts that "like" our page. When I use the Get Data wizard and choose Facebook as the source, it lists "Likes" as a connection option. When I choose this data, it imports the accounts that our Company Facebook page likes, not those who like us. 

 

Is there any way to pull those accounts who like our page using PowerBI?

 

Thanks!

1 ACCEPTED SOLUTION

I believe this is explicitly prevented by Facebook for either privacy and/or corporate IP purposes



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

30 REPLIES 30

procyon82, I used a wrong metric name. I meant page_fans as I shown above.

 

That's better...how can I get it to spit out monthly values?

 

      "values": [
        {
          "value": 7215,
          "end_time": "2016-08-25T07:00:00+0000"
        },
        {
          "value": 7220,
          "end_time": "2016-08-26T07:00:00+0000"
        },
        {
          "value": 7221,
          "end_time": "2016-08-27T07:00:00+0000"
        }

Try to use the field since as a parameter in the URL. More details here.

 

I'm having trouble getting the since function to work in conjunction with the access token... can you provide how you would modify the below to include a since period? 

 

let
YourFacebookObjectName = "datachantblog",
YourAccessToken = "Get the token from Facebook Graph Explorer, or APIGEE", Source = Json.Document(Web.Contents("https://graph.facebook.com/v2.7/" & YourFacebookObjectName & "/insights/page_fans?access_token=" & YourAccessToken)), data = Source[data], #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"values"}, {"values"}), #"Expanded values" = Table.ExpandListColumn(#"Expanded Column1", "values"), #"Expanded values1" = Table.ExpandRecordColumn(#"Expanded values", "values", {"value", "end_time"}, {"value", "end_time"}) in #"Expanded values1"

Dear @sarafenwick

You can modify the line below and add the "since=2016-12-31" as a URL parameter after the question mark:

 

 Source = Json.Document(Web.Contents("https://graph.facebook.com/v2.7/" & YourFacebookObjectName & "/insights/page_fans?since=2016-12-31&access_token=" & YourAccessToken)),
    

 

Yup, I confirm that this is not working anymore. Calls in PowerBI to the Facebook API metrics /insights/* just hang forever "waiting for graph.facebook.com"

Did you use your own page? The code above uses a metric that is only available for page admins.

Anonymous
Not applicable

Yep, I am one of the admins of the page. I did not create it (thus do not own it) but I believe Facebook makes no difference between those. 

I believe this is explicitly prevented by Facebook for either privacy and/or corporate IP purposes



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Ahh ok that makes sense. That was fast. Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.