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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors