Forum Discussion
Google Analytics and Power BI: immediate error after importing (valid dimension and metric combo)
- Anonymous8 years ago
Anonymous,
I have figured out a workaround. It involes simply using the advanced editor within the query editor to manually add additional dimensions and/or metrics. Note that you need to know the API names of the dimensions and metrics, which you can browse here: https://developers.google.com/analytics/devguides/reporting/core/dimsmets
I took a video of my workaround. I simply go into the query editor, go to the Source step within Applied Steps, and then go into the advanced editor. Then I copy and paste, and simply change the names to the dimensions/metrics I want to add. The video explains it better. :)
Anonymous,
I have figured out a workaround. It involes simply using the advanced editor within the query editor to manually add additional dimensions and/or metrics. Note that you need to know the API names of the dimensions and metrics, which you can browse here: https://developers.google.com/analytics/devguides/reporting/core/dimsmets
I took a video of my workaround. I simply go into the query editor, go to the Source step within Applied Steps, and then go into the advanced editor. Then I copy and paste, and simply change the names to the dimensions/metrics I want to add. The video explains it better. :)
Just a follow up as I wanted to post my Source step so here it is (with the numbers scrubbed)
let
Source = GoogleAnalytics.Accounts(),
#"xxxxxxxx" = Source{[Id="xxxxxxxx"]}[Data],
#"UA-xxxxxxxx-3" = #"xxxxxxxx"{[Id="UA-xxxxxxxx-3"]}[Data],
#"xxxxxxxx" = #"UA-xxxxxxxx-3"{[Id="xxxxxxxx"]}[Data],
#"Added Items" = Cube.Transform(#"xxxxxxxx",
{
{Cube.AddAndExpandDimensionColumn, "ga:pagePath", {"ga:pagePath"}, {"Page"}},
{Cube.AddAndExpandDimensionColumn, "ga:pagePathLevel1", {"ga:pagePathLevel1"}, {"Page path level 1"}},
{Cube.AddAndExpandDimensionColumn, "ga:pageTitle", {"ga:pageTitle"}, {"Page Title"}},
{Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}},
{Cube.AddAndExpandDimensionColumn, "ga:hour", {"ga:hour"}, {"Hour"}},
{Cube.AddAndExpandDimensionColumn, "ga:source", {"ga:source"}, {"Source"}},
{Cube.AddMeasureColumn, "Pageviews", "ga:pageviews"},
{Cube.AddMeasureColumn, "Sessions", "ga:sessions"},
{Cube.AddMeasureColumn, "Unique Pageviews", "ga:uniquePageviews"}
})
in
#"Added Items"So I definitely have more than one dimension selected but the error is there right after adding this as a source.
- Anonymous6 years agoNot applicable
@bsimer
Not sure if you ever fixed this - I see your last post was some time ago. But I thought I'd post the solution I found here in case you or anyone else encoutners this issue.
As you noted, sometimes the problem happens when you definitely have valid dimensions and metrics in the query. The error happens at the "Navigation" step of the query, before the part of the query where dimensions or metrics are added at all.
It seems the problem is being causing the navigation step because PowerBI doesn't seem to accept the multiple variable assignments to drill down from GA account->property->view
If you open the Advanced Editor, you should see something like this (I have changed the actual account, property and view numbers of my GA to XXXs, YYYs and ZZZs):
https://i.imgur.com/7gePwJK.png
My fix was to change the code here so that instead of having these three different variables in different steps, the entire navigation down the three different levels of ID was done in the "Cube.Transform" step. So your final version should look like this:
https://i.imgur.com/n4xgO5R.png
This seems to resolves the issue.
Sorry those images are links and not embedded - this forum didn't seem to like me embedding the images in the post.
- Kirill_Moscow6 years agoNew Member
Great solution. It works perfect! Just change your query exactly as on the picture.