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.
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
You can get the number of likes by manipulating the Facebook Graph API URL in the Query formula to call for the [page]/insights/page_fans metric.
Here is an example (modify the page name which is highlighted in bold)
let Source = Facebook.Graph("https://graph.facebook.com/v2.2/datachantblog/insights/page_fans"), #"Removed Other Columns" = Table.SelectColumns(Source,{"values"}), #"Expanded values" = Table.ExpandTableColumn(#"Removed Other Columns", "values", {"value", "end_time"}, {"value", "end_time"}) in #"Expanded values"
If you are considering a rebust Facebook dashboard with Power BI, you can learn some cool tips and tricks in my blog.
Feel free to contact me if you have any further questions.
Hello @DataChant,
I tried to apply the solution that you indicated, but this one has an authentication error and is already authenticated, what can I do?
I had the same problemn. You should to logout to Facebook, then login again. Get new token and use it on Power BI.
It appears tis ain't working anymore.
I copy-pasted the code below, but that gave some errors on the "values" column (does that mean it finds something?). When "Removed Other Colums" and "Expanded Values" were removed though, it just keeps waiting for graph.facebook.com.
Any thoughts? I tried updating the API version number but no result.
I confirm that this is not working anymore. Calls to the Facebook API metrics /insights/* just hang forever "waiting for graph.facebook.com". Something must be broken with the PowerBI Facebook connector. Can anyone help?
What about page likes without knowing who liked your page. How do you get that?
Here is an example with Web.Contents to get your Facebook Likes:
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"
Hi @DataChant,
I've tried to do what you just described, but I have an error: Column1 has not been found...
Do you know why ?
Thanks !!
Can you please share the M expression?
Facebook made some changes recently, and you cannot use the Facebook connector to read user likes.
Hello @DataChant, could you help me with something?
I would like to get the data from page fans like:
date page_fan_add
01/02/2019 12
02/02/2019 15
...
And I'm getting the data by Web.Contentes as you can see below:
let
Fonte = Json.Document(Web.Contents(
"https://graph.facebook.com/v3.2/2079445882318439? fields=name%2Cfan_count%2Clink%2Cusername%2Cposts&access_token=%...%"))
in
Fonte
I found this "page_fan_adds_by_paid_non_paid_unique" at the documentation but I don't know how and if I can use it at the URL, do you know something about it? Can I use it?
Best Regards,
Diego S. Lutckmeier
@DataChant
Of course,
let
Source = Facebook.Graph("https://graph.facebook.com/v2.2/rgmtecnologia/insights/page_fans"),
#"Removed Other Columns" = Table.SelectColumns(Source,{"values"}),
#"Expanded values" = Table.ExpandTableColumn(#"Removed Other Columns", "values", {"value", "end_time"}, {"value", "end_time"})
in
#"Expanded values"
I can no longer read the tanned of the users? Is there another way to get this information for power bi?
Thanks for your help.
Good morning! What do you mean by "web.contents"? I'm facing the same problem but can't figure it out.
Thanks!
Hi,
I too have this error.
Thanks
Thanks. I played around in the Graph API Explorer and found 'fan_count'. The following seems to do the trick.
= Facebook.Graph("https://graph.facebook.com/v2.7/pagename?fields=fan_count")
How do I combine this with dates, so that I can show page likes growth over time?
Engagenment also works, but again I don't know how to combine this with a date.
= Facebook.Graph("https://graph.facebook.com/v2.7/pagename?fields=engagement")
Procyon82, try to use the field since as a parameter in the URL. More details here.
I tried that using unix timestamp, but it just gives me today's total page likes. How do others answer questions regarding page like growth? It can't be that hard...
Did you try using the Web connector and Insights/page_fans directly?
As in using https://www.facebook.com/XXX/insights/page_fans_count ? It tells me not a valid URL.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |