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
Anonymous
Not applicable

Getting wrong values from Facebook

Hi, 

When I try to follow the following turorial 

 

https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-facebook-analytics 

 

I get wrong values for the number of comments in Power BI Desktop. E.g. one post has 0 comments, but Power BI loads it as 9. Another time, there are some comments, but the number of comments shown is 0. 

 

I follow the exact same instructions, i.e. for the nested column I first get the comments and then the number of IDs. 

 

Has anyone any advice?

 

Many thanks

 

Noemi 

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Anonymous,

 

The Facebook connector in Power BI Desktop relies on the Facebook Graph API. As such, features and availability may vary over time. Facebook expired v1.0 of its Graph API on April 30th 2015. Power BI uses the Graph API behind the scenes for the Facebook connector, allowing you to connect to your data and analyze it.

 

Queries that were built before April 30th 2015 may no longer work or return less data. Subsequent to April 30th 2015, Power BI leverages v2.8 in all calls to the Facebook API. If your query was built prior to April 30, 2015 and you have not used it since, you’ll likely need to authenticate again, to approve the new set of permissions that we’ll ask for.

 

Although we attempt to release updates in accordance with any changes, the API may change in a way that affects the results of the queries we generate. In some cases, certain queries may no longer be supported. Due to this dependency we cannot guarantee the results of your queries when using this connector.

 

More details on the change in the Facebook API are available here.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Many thanks for your answer. 

 

I just tried to follow the tutorial mentioned above with my own FB page. 

 

The Power BI script and the posts are both from 2019. 

 

It seems to work for most users, as I havent found any other forum entries regarding this topic. 

 

The M code is:

 

let
    Source = Facebook.Graph("https://graph.facebook.com/v2.8/me/likes"),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "created_time", Splitter.SplitTextByDelimiter("T", QuoteStyle.Csv), {"created_time.1", "created_time.2"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"created_time.1", type date}, {"created_time.2", type time}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"created_time.1", "created_date"}, {"created_time.2", "created_time"}}),
    #"Expanded object_link" = Table.ExpandRecordColumn(#"Renamed Columns", "object_link", {"connections"}, {"object_link.connections"}),
    #"Expanded object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link", "object_link.connections", {"likes"}, {"object_link.connections.likes"}),
    #"Aggregated object_link.connections.likes" = Table.AggregateTableColumn(#"Expanded object_link.connections", "object_link.connections.likes", {{"id", List.Count, "Count of object_link.connections.likes.id"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Aggregated object_link.connections.likes",{{"created_time", type time}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each ([created_date] <> null))
in
    #"Filtered Rows"

It is odd, as there is no obvious pattern to how the wrong number of likes is created. It is not even in the wrong line, it is just completely random # of likes. (I did the same before with comments for the MS Power BI FB page, it worked fine; but then for my FB comments rather than likes and I got wrong numbers again). 

 

Do you have any other idea what it could be?

 

Many thanks 

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.