Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
I am preparing Power BI report for getting Twitter follwers. I want to display report for particular users all the followers, followers count and following count and so on.
I am found the following link https://chris.koester.io/index.php/2015/07/16/get-data-from-twitter-api-with-power-query/
In this link I am not able to get the particular user data. This will find the tweets on the twitter account.
Can you please help me to get the particular user data. Is it possible to get the data using power query(api)?
Solved! Go to Solution.
Hi @ImkeF,
I got the solution. Using the following Api call https://api.twitter.com/1.1/users/show.json?user_id=123456 I am getting the required detail then I have translated the json data(Return result from the API call) into table. The table represent each row as all information so I use Pivot table so It gives me the required result.
#"Converted to Table" = Record.ToTable(FormatAsJsonQuery),
#"Pivoted Column" = Table.Pivot(#"Capitalized Each Word", List.Distinct(#"Converted to Table"[Name]), "Name", "Value")
Using the above code snippet I got my required result.
Hi @Krunalbpatel,
You would need to firstly export data about followers in Excel, then import data from Excel to Power BI Desktop and create relevant reports.
Please follow the instructions in the similar blogs below to calculate Twitter followers and create Twitter reports in Power BI Desktop.
Counting Overlapping/Shared Twitter, Facebook, Instagram, etc. Followers
Import Twitter data to Excel & Power BI using Microsoft Flow or Zapier
Thanks,
Lydia Zhang
Hi @v-yuezhe-msft,
I have got the twitter user detail using the API. Here is the API call to get the particular user data.
https://api.twitter.com/1.1/users/show.json?user_id=123456
Using the above API call I am getting the required detail also. But Now problem is that I am not able to getting the result in a single record. I am getting the result in a record format. So I am getting only 2 column as a result. And each value as a record.
Hi @Krunalbpatel,
the URL you've given returns a lot of data, but I cannot spot a record where followers are returned (just the total number of them).
Could you please give more details about the record in question?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF,
I got the solution. Using the following Api call https://api.twitter.com/1.1/users/show.json?user_id=123456 I am getting the required detail then I have translated the json data(Return result from the API call) into table. The table represent each row as all information so I use Pivot table so It gives me the required result.
#"Converted to Table" = Record.ToTable(FormatAsJsonQuery),
#"Pivoted Column" = Table.Pivot(#"Capitalized Each Word", List.Distinct(#"Converted to Table"[Name]), "Name", "Value")
Using the above code snippet I got my required result.
Hi @Krunalbpatel,
now I see what you're after. That's a couple of unnecessary steps here, that will cost performance.
An easier and faster way would be this:
Table.FromRecords({FormatAsJsonQuery})
! watch the curly brackets !
If you just want to retrieve the number of followers, you even don't have to perform this step, just put the name of the field you're after into square brackets like this:
FormatAsJsonQuery[followers_count]
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
31 | |
28 | |
26 | |
26 |
User | Count |
---|---|
54 | |
49 | |
41 | |
15 | |
13 |