When you work on real-world projects in power BI, you would probably have different environments Like DEV, UAT, Pre-Prod and Prod. It is important for you and your audience to know what the data is coming from. Am I looking at Dev or UAT data or I am actually looking at real data in Production environment. You may have asked or been asked with a question like “Where the data is coming from?”. It is important to know how trustworthy the data you’re analysing is. In this post I show you an easy way to show the environment your Power BI report is connected to.
How It Works
To display the environment name you use query parameters, then you reference that parameter, turn it to a table and add columns to show the environments accordingly. Easy right?
Read more about query parameters from a list output here.
Depending on your scenario the implementation might be slightly different, but the principals are the same. In this post I use a SQL server database. Therefore I need to Parameterise server name. in real world you may also need to parameterise the database name. Again, if your case is quite different, like if you get data from Excel, then the Excel path can be different for different environments. Let’s dig-in.
- Open Query Editor
- Click “Manage Parameters”
- Click “New”
- Enter “Name” and “description”
- Tick “Required”
- Select “Text” in “Type”
- Select “List of values” in “Suggested Values” and type in server names for different environments
- pick a “Default Value” and “Current Value”
- Click OK
So far you created a new parameter that can be used to get data from a SQL Server data source.The next steps show you how to use that parameter to show the environments in your reports.
Continue reading “Good Practices: Always Display the Reporting Environment”