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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

"Left join" of Google Analytics Custom Dimensions?

Hi,

I've got a GA query as such:

 

    #"Added Items" = Cube.Transform(#"00000000",
        {
            {Cube.AddAndExpandDimensionColumn, "ga:hostname", {"ga:hostname"}, {"Hostname"}},
            {Cube.AddAndExpandDimensionColumn, "ga:pagePath", {"ga:pagePath"}, {"Page"}},
            {Cube.AddAndExpandDimensionColumn, "ga:source", {"ga:source"}, {"Source"}},
            {Cube.AddAndExpandDimensionColumn, "ga:campaign", {"ga:campaign"}, {"Campaign"}},
            {Cube.AddAndExpandDimensionColumn, "ga:dimension2", {"ga:dimension2"}, {"XYZ 1"}},
            {Cube.AddAndExpandDimensionColumn, "ga:dimension1", {"ga:dimension1"}, {"XYZ 2"}},
            {Cube.AddAndExpandDimensionColumn, "ga:date", {"ga:date"}, {"Date"}},
            {Cube.AddMeasureColumn, "Pageviews", "ga:pageviews"},
            {Cube.AddMeasureColumn, "Users", "ga:users"}
        })

 

The two custom dimensions are fairly new.

By adding them, the dataset is limited to the timespan since we added them.

Is there any way to have GA return data for all time, making the values for them "(not set)" or something?

I suspect it's a limitation in the GA APIs, but thought it couldn't hurt to ask.

Have a brewing idea that I could make an "append" query limited to all time before we added them...?

 

Ideas appreciated. 🙂

Lars-Erik

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

it's related to Google API, so if you can create such a query using different tools, then it should also be possible in Power Query. But it's not really M question

 

As for the append idea - you could do that, but you have to consider that the values will be doubled for the set with custom dimensions (as they are also included in full query). You could work around that by

  • filtering the full query to time period before the custom measures were added and appending after that
  • using merge instead of append, which will result in adding the dimensions to the full set only where the join criteria is met


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

it's related to Google API, so if you can create such a query using different tools, then it should also be possible in Power Query. But it's not really M question

 

As for the append idea - you could do that, but you have to consider that the values will be doubled for the set with custom dimensions (as they are also included in full query). You could work around that by

  • filtering the full query to time period before the custom measures were added and appending after that
  • using merge instead of append, which will result in adding the dimensions to the full set only where the join criteria is met


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Thanks,

 

I managed to make this work with an append. Also learned that M is lazy and smart enough to push time parameters up to the GA queries, so all good! 🙂

 

Lars-Erik

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