Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Google BigQuery formatting issues with Google Analytics sample dataset

So I'm trying to play around with the Google Analytics dataset found in Google BigQuery. Just a little background on this dataset: 

  • Contains all kinds of data found for a website
  • There are TONS of columns in original data source
    • Some columns are formatted just fine
    • There are also sections of columns that contain data for subsections. For example, there are sections titled "totals", "trafficSource", "device", "geoNetwork", "customDimensions", and "hits" that have subsections (ex: Column "customDimensions" has two subsection columns titled "customDimensions.index" and "customDimensions.value"

When I connect to BigQuery in Power BI and it loads the data, I'm noticing some formatting issues. Check out the screenshot below:

 

You'll notice that some columns are formatted just fine and it is understandable (i.e. "channelGrouping", "socialEngagementType", "fullVisitorId"). But it looks like the columns "customDimensions" and "hits" are not splitting up into their subsections and is combined into one messy column in a format I don't understand. 

 

 

When I go to look at the data source on BigQuery, however, it looks fine:

 

 

 

 

 

 

 

 

 

Even though the preview only has one row of data available, you can see that the "hits" column is correctly separated into its respective subsections.

 

How do I go about formatting the query to look more like this? Here are my ideas:

  • I could compose a query in BigQuery using SQL and extract the data to a CSV file. That way I'd only get the data I need and I would import it into Power BI using a CSV instead of connecting to BigQuery.
  • Format the data in Power BI by splitting the columns (but I'm not sure where to even start with the messy data)
  • Is there a way to create a query and pull specific data using SQL in Power BI?

 

Any feedback is appreciated. Cheers! 

 

 

 

 

 

 

 

 

 

2 Replies