0
© 2013. All rights reserved.
USING MICROSOFT POWER QUERY TO
ANALYZE FACEBOOK
Microsoft Excel | Power Query | Power View
Ye...
© 2013. All rights reserved.
DOWNLOADING & INSTALLING POWER
QUERY
The first step in the process is to download Power Query.
© 2013. All rights reserved.
Downloading &
Installing Power
Query
Power Query is easy to find. I just did a Bing search an...
© 2013. All rights reserved.
A QUICK TOUR OF POWER QUERY
As I mentioned before, Power Query is an extended version of the ...
© 2013. All rights reserved.
A Quick Tour of
Power Query
When you install Power Query, you will notice a new
ribbon bar ha...
© 2013. All rights reserved.
A Quick Tour of
Power Query
You can query from files… especially interesting here is
the From...
© 2013. All rights reserved.
A Quick Tour of
Power Query
You can query other databases… including Oracle, DB2,
MySQL, Post...
© 2013. All rights reserved.
A Quick Tour of
Power Query
And you can query from other sources… including
SharePoint Lists,...
© 2013. All rights reserved.
USING POWER QUERY TO QUERY YOUR
FACEBOOK FRIENDS
Now that we have Power Query installed, its ...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
To start off, select the POWER QUERY ribbon ...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
This will open up the Facebook options form....
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
In the Connection name you can select the ty...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Once you have selected the source and type o...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Since this was the first time that I queried...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
It will ask you for your Facebook credential...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Once you have stored your Facebook credentia...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Power Query will now return back a subset of...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Double clicking on the link will drill down ...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
You can keep on drilling down into the recor...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
If you want to expand out any of the data at...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
Now your query will start to flatten out and...
© 2013. All rights reserved.
Using Power Query
to Query your
Facebook Friends
The query will now be available within Excel...
© 2013. All rights reserved.
USING POWER VIEW TO ANALYZE YOUR
FACEBOOK FRIENDS
Once you have queried Facebook using Power ...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
To start creating the Power View dashboard,...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
This will open up the blank Power View canv...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
The first query that I will create is a sim...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
Then I converted the Table into a Matrix by...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
To count the records I then added the objec...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
Since this element is a Matrix, I can now c...
© 2013. All rights reserved.
Using Power View
to Analyze your
Facebook Friends
After adding a title, and another card view...
© 2013. All rights reserved.
USING POWER QUERY TO ANALYZE YOUR
FACEBOOK FEEDS
Analyzing your friends on Facebook is nice, ...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
To start off, select the POWER QUERY ribbon ...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
The Feed query from Facebook returns a littl...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
But we need a little more for this analysis....
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
This will give us the name of person that is...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Expand out the status_type field.
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Expand out the object_id field.
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
And finally, expand out the shares field.
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
After manipulating the query, click on the D...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Now our query is almost ready to use. The on...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
So add a new column to the query for the Yea...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Add another field for the Month.
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
And finally, add a Period column that combin...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Now, select the query and click on the Power...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Now create a Matrix Table to analyze the act...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Now create a more detailed matrix field by c...
© 2013. All rights reserved.
Using Power Query
to Analyze your
Facebook Feeds
Then convert the table to a Bar Chart. This ...
© 2013. All rights reserved.
ANALYZING YOUR FACEBOOK FRIENDING
HISTORY
Something else that I thought would be interesting ...
© 2013. All rights reserved.
Analyzing Your
Facebook Friending
History
To track friending posts, add another column to the...
© 2013. All rights reserved.
Analyzing Your
Facebook Friending
History
Now that we have that additional piece of data we c...
© 2013. All rights reserved.
ANALYZING FEED ACTIVITY BY APPLICATION
Hidden in the Feed query are other details that are in...
© 2013. All rights reserved.
Analyzing Feed
Activity by
Application
In this example I created a simple dashboard using Pow...
© 2013. All rights reserved.
Analyzing Feed
Activity by
Application
Filtering out the data by year shows us what was hot a...
© 2013. All rights reserved.
Analyzing Feed
Activity by
Application
Also, by creating a date hierarchy in the report, we c...
© 2013. All rights reserved.
SUMMARY
Power Query is a great new tool to take advantage of. Using it to query the less stru...
http://slideshare.net/murrayfife/presentations
Murray Fife
Microsoft MVP
Using Microsoft Power Query to Analyze Facebook Data
Upcoming SlideShare
Loading in...5
×

Using Microsoft Power Query to Analyze Facebook Data

5,551

Published on

Yesterday I was tipped off about a new add-on for Excel 2013 that Microsoft have just released called Power Query, so I had to take a look at it. As the name hints, this is the data query function on steroids, and it looks great.
The following walkthrough is an example of what I did.

Published in: Technology
1 Comment
12 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,551
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
208
Comments
1
Likes
12
Embeds 0
No embeds

No notes for slide

Transcript of "Using Microsoft Power Query to Analyze Facebook Data"

  1. 1. © 2013. All rights reserved. USING MICROSOFT POWER QUERY TO ANALYZE FACEBOOK Microsoft Excel | Power Query | Power View Yesterday I was tipped off about a new add-on for Excel 2013 that Microsoft have just released called Power Query, so I had to take a look at it. As the name hints, this is the data query function on steroids, and it looks great. The following walkthrough is an example of what I did.
  2. 2. © 2013. All rights reserved. DOWNLOADING & INSTALLING POWER QUERY The first step in the process is to download Power Query.
  3. 3. © 2013. All rights reserved. Downloading & Installing Power Query Power Query is easy to find. I just did a Bing search and found it right away on the Microsoft Download Center: http://www.microsoft.com/en- us/download/details.aspx?id=39379
  4. 4. © 2013. All rights reserved. A QUICK TOUR OF POWER QUERY As I mentioned before, Power Query is an extended version of the Data Query function that you may have used in Excel in the past, except the data sources that it is able to query so much better. In this section we will look at what the Power Query Add-In provides us.
  5. 5. © 2013. All rights reserved. A Quick Tour of Power Query When you install Power Query, you will notice a new ribbon bar has been added.
  6. 6. © 2013. All rights reserved. A Quick Tour of Power Query You can query from files… especially interesting here is the From folder option that allows you to query the file system and return back file information.
  7. 7. © 2013. All rights reserved. A Quick Tour of Power Query You can query other databases… including Oracle, DB2, MySQL, PostgreSQL and Teradata databases.
  8. 8. © 2013. All rights reserved. A Quick Tour of Power Query And you can query from other sources… including SharePoint Lists, Active Directory, Big Data datasources, and Facebook. All of these additional data sources can be queried and combined into data mashups… how cool is that.
  9. 9. © 2013. All rights reserved. USING POWER QUERY TO QUERY YOUR FACEBOOK FRIENDS Now that we have Power Query installed, its time to start using it to grab some of the data. In this example I will show how you can use Power Query to query your Facebook account.
  10. 10. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends To start off, select the POWER QUERY ribbon bar within Excel and select the From Facebook option from the From Other Sources menu button dropdown.
  11. 11. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends This will open up the Facebook options form. If you want to mine information on another user, then you can type in their username, or in this case, use me to access your own personal data.
  12. 12. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends In the Connection name you can select the type of information that you want to query from Facebook. In this case I want to find all of my friends.
  13. 13. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Once you have selected the source and type of data that you want to query then click the OK button.
  14. 14. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Since this was the first time that I queried Facebook, it is going to ask me to sign in.
  15. 15. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends It will ask you for your Facebook credentials.
  16. 16. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Once you have stored your Facebook credentials within Power Query, you won’t have to do this any more. Note: if you want to update or remove these credentials, just click on the Data Source Settings button within the Machine Settings group, and you will be able to delete the username and password.
  17. 17. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Power Query will now return back a subset of the data from Facebook as a test query. Notice though that some of the data shows up as a green hyperlink like the data in the object_link field. This means that there is more data beneath.
  18. 18. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Double clicking on the link will drill down into that data.
  19. 19. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends You can keep on drilling down into the record to navigate through the data.
  20. 20. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends If you want to expand out any of the data at the lower levels and include it in your query, then lick on the expansion icon in the top right of the field name header, and you will be able to see all of the available sub-fields. Select the fields that you want to include and click OK.
  21. 21. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends Now your query will start to flatten out and you can use the data. Once you have finished manipulating the query, click the Done button.
  22. 22. © 2013. All rights reserved. Using Power Query to Query your Facebook Friends The query will now be available within Excel as a worksheet.
  23. 23. © 2013. All rights reserved. USING POWER VIEW TO ANALYZE YOUR FACEBOOK FRIENDS Once you have queried Facebook using Power Query, you will probably want to visualize it. The best tool for that is Power View. In this example I will show how to use Power View to quickly create a dashboard analysis.
  24. 24. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends To start creating the Power View dashboard, select the query data within Excel and then click on the Power View button within the Reports group of the Insert ribbon bar.,
  25. 25. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends This will open up the blank Power View canvas with all of the query fields available within the field explorer.
  26. 26. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends The first query that I will create is a simple analysis of my friends. In this case the gender breakdown. To do this I just selected the object_link_gender field and added it to my reporting canvas.
  27. 27. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends Then I converted the Table into a Matrix by selecting Matrix from the Table button on the DESIGN ribbon bar.
  28. 28. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends To count the records I then added the object_link_gender field to the VALUES group in the report designer panel.
  29. 29. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends Since this element is a Matrix, I can now change it to a chart. From the Other Chart options in the DESIGN ribbon bar, select the Pie option.
  30. 30. © 2013. All rights reserved. Using Power View to Analyze your Facebook Friends After adding a title, and another card view to the dashboard I have a quick summary of my Facebook friends.
  31. 31. © 2013. All rights reserved. USING POWER QUERY TO ANALYZE YOUR FACEBOOK FEEDS Analyzing your friends on Facebook is nice, but something that is even more interesting is to analyze the Facebook Feeds. Power Query allows you to download your complete Facebook feed history so that you can take a walk down memory lane. In this example I will show how you can use Power Query to view you Facebook Feed activity.
  32. 32. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds To start off, select the POWER QUERY ribbon bar within Excel and select the From Facebook option from the From Other Sources menu button dropdown. In the Connection name select the Feed option.
  33. 33. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds The Feed query from Facebook returns a little more information than the Friends query…
  34. 34. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds But we need a little more for this analysis. Expand out the object_link field.
  35. 35. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds This will give us the name of person that is posting to our timeline
  36. 36. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Expand out the status_type field.
  37. 37. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Expand out the object_id field.
  38. 38. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds And finally, expand out the shares field.
  39. 39. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds After manipulating the query, click on the Done button to transfer it to the Excel workbook.
  40. 40. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Now our query is almost ready to use. The only problem is that I want to analyze this data by the date, and the create_time field is a little too granular.
  41. 41. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds So add a new column to the query for the Year, and use a little bit of string manipulation to extract the year from the create_time field. (Normally I would use the Year() function, but it doesn’t like the Facebook format of the date/time)
  42. 42. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Add another field for the Month.
  43. 43. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds And finally, add a Period column that combines the year and the month.
  44. 44. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Now, select the query and click on the Power View button within the Reports group of the INSERT ribbon bar.
  45. 45. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Now create a Matrix Table to analyze the activity by year. I didn’t really use Facebook that much in 2007 & 2008 I guess…
  46. 46. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Now create a more detailed matrix field by combining the Year and the month.
  47. 47. © 2013. All rights reserved. Using Power Query to Analyze your Facebook Feeds Then convert the table to a Bar Chart. This allows me to see where the peaks by month are for my feed posts – October was the obvious winner in general because that’s my birthday month, although February of 2009 must have been a power friending month… Additionally, add a line graph to the dashboard, using the Period field that you created to show the history over time. Very cool.
  48. 48. © 2013. All rights reserved. ANALYZING YOUR FACEBOOK FRIENDING HISTORY Something else that I thought would be interesting to analyze is the actual Feed content from Facebook. Since the query returns the activity header, why not analyze the type of feed. In this example I will show how to analyze the feeds to track friending activity.
  49. 49. © 2013. All rights reserved. Analyzing Your Facebook Friending History To track friending posts, add another column to the Feed query and mark anything that finishes with “are now friends.”.
  50. 50. © 2013. All rights reserved. Analyzing Your Facebook Friending History Now that we have that additional piece of data we can create a simple Power View dashboard showing the friending activity my month. Very cool.
  51. 51. © 2013. All rights reserved. ANALYZING FEED ACTIVITY BY APPLICATION Hidden in the Feed query are other details that are interesting to visualize. One of them is the application type. In this example I will show a simple analysis of the Facebook feed to track the applications.
  52. 52. © 2013. All rights reserved. Analyzing Feed Activity by Application In this example I created a simple dashboard using Power View. The cool think here is that the icon field shows as an image – Power View automatically recognizes it, and if we add it as a field then we can see all of the posts broken out to source.
  53. 53. © 2013. All rights reserved. Analyzing Feed Activity by Application Filtering out the data by year shows us what was hot at the time.
  54. 54. © 2013. All rights reserved. Analyzing Feed Activity by Application Also, by creating a date hierarchy in the report, we can drill down by year down into the monthly periods for more information. I don’t know why my dog – “Barney Fife” was posting so much in 2012… I need to investigate that more.
  55. 55. © 2013. All rights reserved. SUMMARY Power Query is a great new tool to take advantage of. Using it to query the less structured data like Facebook is just the starting point. Once you have played around with it a little you may want to try creating data mash-up’s by combining the data from one data source with another. Give it a go and drop me a note when you create something cool.
  56. 56. http://slideshare.net/murrayfife/presentations Murray Fife Microsoft MVP
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×