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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
MattAllington
Community Champion
Community Champion

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.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

30 REPLIES 30
DataChant
Most Valuable Professional
Most Valuable Professional

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"
        }

DataChant
Most Valuable Professional
Most Valuable Professional

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"
DataChant
Most Valuable Professional
Most Valuable Professional

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"

DataChant
Most Valuable Professional
Most Valuable Professional

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. 

MattAllington
Community Champion
Community Champion

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.
I will not give you bad advice, even if you unknowingly ask for it.

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.