Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Last active March 21, 2017 10:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Hugoberry/cf72160ea8cb201c41c34524a96e9b9a to your computer and use it in GitHub Desktop.
Get Power Query data source Connection String
(port as text) =>
let
//Get $Embedded$ database name
catalog = AnalysisServices.Databases("localhost:"&port)[Name]{0},
//Run DMV query to get data source details
dataSources = AnalysisServices.Database("localhost:"&port,catalog,
[Query="select * from $system.TMSCHEMA_DATA_SOURCES"])
in
dataSources[ConnectionString]{0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment