Forum Discussion
Managing Dev,Test and Prod Environments in Power BI Desktop.
- 8 years ago
Hi Anonymous,
You can build your reports in different environments and you can transfer from Dev to test or prod by using data source parameter.
Then we can get data using the Parameter that we created. In power query we can get different data of different environment by changing the Current value.For more details, please check the online document.
Here is the M code in power query for your reference.
let Source = Sql.Databases(Parameter1), Power_BI_Test = Source{[Name="databasename"]}[Data], dbo_Financial_1 = databasename {[Schema="dbo",Item="Financial_1"]}[Data] in dbo_Financial_1Regards,
Frank
Hi Anonymous,
You can build your reports in different environments and you can transfer from Dev to test or prod by using data source parameter.
Then we can get data using the Parameter that we created. In power query we can get different data of different environment by changing the Current value.For more details, please check the online document.
Here is the M code in power query for your reference.
let
Source = Sql.Databases(Parameter1),
Power_BI_Test = Source{[Name="databasename"]}[Data],
dbo_Financial_1 = databasename {[Schema="dbo",Item="Financial_1"]}[Data]
in
dbo_Financial_1Regards,
Frank
I doubt this something you can do only for Import mode and Not on Direct Query.
- HalloWorld2 years ago
Advocate II
You cannot make new columns since that will ask you to import all tables:
Yet, you can get around that a bit. Write as much as you can in the sql query (and do the rest in DAX measures perhaps):
= Sql.Database(environment, "testDB", [Query="select * from dbo.test"])(I tested a bigger query as well). Then, you need to agree to run a native database query:
After that, close by taking over the change:
And your model will be parametrized with the value that you chose, and you can change it again in the "Transform data" tool: