Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

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:

Capture.PNG

 

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:

Capture.PNG

 

 

 

 

 

 

 

 

 

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 2
v-yuta-msft
Community Support
Community Support

Hi pstrand64,

 

To use SQL statement when connecting to Google Big Query, you can use ODBC connector instead. For details, you can refer to:

https://cloud.google.com/blog/big-data/2016/11/how-to-connect-bigquery-to-microsoft-excel-and-other-....

 

In addtion, ODBC driver only support import mode, so if you are using direct query mode you should using Google Big Query connector.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Jimmy, 

 

Thanks for the response, man. So what you're saying is that I can query the data with SQL from Google BigQuery inside Power BI by selecting the option "OBDC connector"?

 

Sorry if I'm not understanding this or asking the right questions, I'm a little new to SQL and data wrangling (also new to Power BI).

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.