Created
May 25, 2020 22:07
-
-
Save katoen/15954a90efe98ec4b608ff1a1e7258d6 to your computer and use it in GitHub Desktop.
REST API Power BI in Power Query - List tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_gettables | |
Easy auth token: | |
https://datagulp.com/powerbi/power-bi-rest-api-how-to-get-authentication-token-with-powershell-cmdlets/ | |
*/ | |
let | |
Source = Json.Document( | |
Web.Contents( | |
"https://api.powerbi.com/v1.0/myorg/datasets/"& DATASETID &"/tables", | |
[Headers = [#"Content-Type" = "application/json", accept = "application/json", Authorization | |
= "Bearer " & PBIKEY]] | |
) | |
), | |
value = Source[value], | |
#"Converted to Table" = Table.FromList( | |
value, | |
Splitter.SplitByNothing(), | |
null, | |
null, | |
ExtraValues.Error | |
), | |
#"Expanded Column1" = Table.ExpandRecordColumn( | |
#"Converted to Table", | |
"Column1", | |
{"name"}, | |
{"name"} | |
) | |
in | |
#"Expanded Column1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment