After struggling for months trying to use Power Bi to extract a VSTS user list (UserEntitlements) along with their subscription level with little on the internet. I finally got it working. The difficulty is authentication and Power BI not natively supporting Basic and passing the Authenticatrion Header using the PAT token. Also OAuth2 is a problem here with Power BI still.
If you start of with a blank query, the M code you need is this:
let Source = Json.Document(Web.Contents("https://<<ACCOUNT NAME>>.vsaex.visualstudio.com/DefaultCollection/_apis/userentitlements?api-version=4.1-preview")), #"Converted to Table" = Record.ToTable(Source), Value = #"Converted to Table"{1}[Value], #"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"id", "user", "accessLevel", "lastAccessedDate", "projectEntitlements", "extensions", "groupAssignments"}, {"Column1.id", "Column1.user", "Column1.accessLevel", "Column1.lastAccessedDate", "Column1.projectEntitlements", "Column1.extensions", "Column1.groupAssignments"}) in #"Expanded Column1"
Then edit the Data Source Settings and ensure Basic authentication is select, put in your PAT token for VSTS in the password box, the user name can be left blank.
Refresh your data and that should pull down the data you need.
When you publish to the cloud, ensure your dataset has the PAT token populated. It doesn't need to go throught the on-premise gateway as VSTS is on the cloud.