On my last blog post here we built a dashboard that analyzes the count & geolocation of users who talk about Power BI, Tableau or Qlik on facebook. In today’s post we will take the dashboard one step further and provide insights on the trend of each brand over the last 90 days.
Follow this tutorial to know how to analyze the trends of multiple brands. In our exmaple – We analyze the people who are talking about Power BI, Tableau & Qlik.
Before we start, here are some cool insights on Zombies
Let’s use the dashboard above to analyze the data . As you can see from the line chart that is highlighted below, on February 5, Qlik enjoyed a sudden burst of shares on Facebook.
Looking at Qlik’s Facebook post here, I initially suspected that the peak originated from this scary Walking Dead dashboard:
But I was probably wrong. On the same day Tableau also got a burst of Facebook shares. So there was a different event that triggered this massive enthusiasm among BI fans – Can you guess?
So Gartner published their report on February 4, and the BI leaders took advantage of their achievement and celebrated the news. For some reason Microsoft didn’t enjoy the same peak. I didn’t find a relevant post on Power BI Facebook page. Perhaps it explains the missing burst of shares for Power BI.
Anyway, the bottom line of this quick data analysis – Don’t trust Zombies when you perform data analysis.
In Home tab, click Edit Queries.
Click on the query GetInsightsByPage, and then click Advanced Editor.
Modify the line that starts with:
Source = Facebook.Graph(…
First, change the version number from v2.2 to v2.5 and add the highlighted text:
After clicking Done, you will get the following error. Ignore it, we will fix it in a minute.
Note that by the changes above, we “tricked” Power Query to use REST API calls with version 2.5 of the Graph API instead of version 2.2, which Microsoft officially supports. The reason for this change is that the latest version works better with Page Insights, and returns data of longer periods.
In Home tab click New Source drop down button and select Blank Query.
Rename the new query to SincePeriod.
In the formula bar of the query SincePeriod enter the following formula:
Notice that this formula returns the current fixed UTC date and time.
Let’s subtract 90 days from the current date and time:
Just change the the formula by subtracting Duration.From(90):
= DateTimeZone.FixedUtcNow() – Duration.From(90)
Now we can convert the date & time to date by applying Date.From on the previous formula:
= Date.From(DateTimeZone.FixedUtcNow() – Duration.From(90))
Now we will convert the date to text by applying Text.From on the previous formula.
= Text.From(Date.From(DateTimeZone.FixedUtcNow() – Duration.From(90)))
At last our query SincePeriod returns the expected textual date, we can continue to work on our queries.
Select the query Share Results.
Select the column Time, click Date Type: Any, and then click Date in the drop down menu.
Click Close & Apply in Home tab, and you are ready to build new time-dependent visualizations.
And here is a dashboard that you can create as a result: