Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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!
Solved! Go to Solution.
I believe this is explicitly prevented by Facebook for either privacy and/or corporate IP purposes
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"
}
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.
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
Ahh ok that makes sense. That was fast. Thank you!