Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Power BI does not reflect Google Analytics

I've connected Power BI Desktop to Google Anayltics, here is the MDX:

let
    Source = GoogleAnalytics.Accounts(),
    #"XXXXXXXX" = Source{[Id="XXXXXXXX"]}[Data],
    #"UA-XXXXXXXX-1" = #"XXXXXXXX"{[Id="UA-XXXXXXXX-1"]}[Data],
    #"YYYYYYYY" = #"UA-XXXXXXXX-1"{[Id="YYYYYYYY"]}[Data],
    #"Added Items" = Cube.Transform(#"YYYYYYYY",
        {
            {Cube.AddAndExpandDimensionColumn, "ga:pagePath", {"ga:pagePath"}, {"Page"}},
            {Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}},
            {Cube.AddMeasureColumn, "Unique Pageviews", "ga:uniquePageviews"}
        }),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Items", {"Page"})
in
    #"Removed Errors"

 

I've created a custom column (named page test) that that assigns a string if the page contains a particular string, for example if the page contains "meter-applications" assign Meter Applications. From April 2021 until today the dashboard shows that there are only two pages that contains "meter-applications" with a total of 3308 unquie pageviews, see screenshot below:

 

However, when comparing to Google Anlytics report, the number is way under and it's also missing another two pages:

 

The power BI visuale is way under for all pages, and is even missing some. I've tried filtering to the time period in power query and filtering to only the pages containing the strings I've wanted and that doesn't seem to fix it. I'm at a loss as to why Power BI won't report the Google Anyltics data propberly.

 

Any help is much appreciated!

2 Replies