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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Gracie
Helper II
Helper II

Import Data From Google Analytics

I want to get data from Google Analytics for last 30 days or even a year. But my GA account has a lot of data. (For example, I have 600,000 rows for just 5 days.) 

 

This is my query:

let
Source = GoogleAnalytics.Accounts(),
#"12345678" = Source{[Id="12345678"]}[Data],
#"UA-12345678-2" = #"12596977"{[Id="UA-12345678-2"]}[Data],
#"3456789" = #"UA-12345678-2"{[Id="3456789"]}[Data],
#"Added Items" = Cube.Transform(#"3456789",
{
{Cube.AddAndExpandDimensionColumn, "ga:city", {"ga:city"}, {"City"}},
{Cube.AddAndExpandDimensionColumn, "ga:country", {"ga:country"}, {"Country"}},
{Cube.AddAndExpandDimensionColumn, "ga:region", {"ga:region"}, {"Region"}},
{Cube.AddAndExpandDimensionColumn, "ga:pagePath", {"ga:pagePath"}, {"Page"}},
{Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}}
{Cube.AddMeasureColumn, "Pageviews", "ga:pageviews"}
}),
#"Filtered Rows" = Table.SelectRows(#"Added Items", each[Date] >= #date(2017,8,1) and [Date] <= #date(2017,8,31))
in
#"Filtered Rows"

 

The query only returns 1,000,000 rows.  But it should return more than that. Does it have a limitation to transfer GA data to Power BI??   I ran the query several times, sometimes, I got the data format error. 

 

Help, please!

1 REPLY 1
Anonymous
Not applicable

@Gracie,

There isn't a row limitation in Power BI Desktop. Power BI Desktop request all of the data that Google Analytics API returns, however, the underlying data Google Analytics API returns is itself sampled, you can review the blog to get more details.

You can follow the guide in this blog to break your large data range into multiple smaller date ranges and queries to avoid sampling, then connect to the data in Power BI Desktop.

Regards,
Lydia

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors