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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Yuhan
Regular Visitor

Google Analytics: How to specify samplingLevel?

As far as I know, Power BI still uses the old Core Reporting API v3 to connect to Google Analytics, not v4. For those that don't know, you could reduce sampling when querying GA data by specifying samplingLevel=HIGHER_PRECISION. Source: https://developers.google.com/analytics/devguides/reporting/core/v3/reference#samplingLevel 

 

 If that is the case, is there a way to input the samplingLevel in the M code when opening the Advanced Editor in the query editor?

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Yuhan ,

 

I don't have a google account, so I can't test for you currently. I find that you can set sample values for the parameters in the Query Explorer.

le.PNG

Or, maybe you can refer to this post to create one parameter: Passing parameters for Google Analytics in the Advanced Editor

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yuhan
Regular Visitor

@IceyThanks for linking the Query Explorer, I did not know of this.

 

However the Query Explorer outputs queries as an URI. I'm guessing Power Bi is letting us write our queries in M and then converting that into an URI for Google. But some options available in the API seems to be unsupported in M. For example, the query URI may include a samplingLevel option, but how can I code that using the Advanced Editor?

 

I'm not sure the passing parameters do the trick either, because they are written in M too.

Icey
Community Support
Community Support

Hi @Yuhan ,

 

I find something interesting in GitHub: https://github.com/maxim-uvarov/PQGoogleAnalytics. Maybe it could help you.

google.PNG

 

You can download the PBIX file here: https://github.com/maxim-uvarov/PQGoogleAnalytics/releases.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors