GoogleAnalytics.Report OpenBI
A Google Analytics 4 report: the dimensions and metrics you name, for a property, between two dates.
Group: Online services. OpenBI’s own: Power Query M has no function of this name.
Syntax
GoogleAnalytics.Report(property as text, dimensions as any, metrics as any, optional options as nullable record) as table
| Parameter | Type | Description |
|---|---|---|
property | text | The property: properties/123456789, or its number alone. |
dimensions | any | A list of the dimensions' API names, or one text with commas: "date, country". |
metrics | any | A list of the metrics' API names, or one text with commas; at least one. |
options | nullable record optional | StartDate and EndDate, as Google Analytics writes dates ("2026-01-01", "28daysAgo", "yesterday"); the last 28 days to yesterday unless you say. |
Returns
table. A column per dimension, then per metric, as you named them; a row per combination.
Remarks
- The date dimension comes as dates; other dimensions as text. Metrics are numbers, whole numbers (Int64.Type) where Google Analytics says so.
- Every row is read, page by page.
GoogleAnalytics.Accountslists the properties and their names. - Sign in with your own Google Cloud project's OAuth client, or a service account's key.
Compared with Power Query
An OpenBI function: Power Query has none like it, so a query that uses it runs in OpenBI only, not in Power BI Desktop or the Power BI service.
Power Query has no GoogleAnalytics.Report: Power BI reads a report through the navigation of GoogleAnalytics.Accounts. A query that uses it runs in OpenBI only.
Examples
Users and sessions by day
GoogleAnalytics.Report("properties/123456789", {"date"}, {"activeUsers", "sessions"}, [StartDate = "2026-01-01", EndDate = "2026-01-31"])
Result: not shown here: it needs a Google Analytics property and a sign-in.
Page views by country, the last 28 days
GoogleAnalytics.Report("123456789", "country", "screenPageViews")
Result: not shown here: it needs a Google Analytics property and a sign-in.