Microsoft released today a new update of Power BI Desktop with some new cool features here. In particular, I find the new Power BI templates as one of the more powerful tools, as it allows me to easily reuse my dashboards in the most easier way 🙂
Let’s see an example using one of the dashboards that analyzes a specific Facebook Page:
I opened the .PBIX file and clicked Edit Queries.
There is a new button – Manage Parameters.
After I clicked the Manage Parameters button, a new Parameters dialog appeared.
I clicked on New.
I added a new parameter. Name: FacebookPage. Then I added a description (“The Facebook Page object name or ID”)
I change the Type from Any to Text.
I added the current value for the FacebookPage parameter by editing Current Value. Then I clicked OK.
That’s cool. A new item was added at the bottom of the Queries pane. That is my new parameter. I can also edit it from the main pane.
Now is the tricky part. I edited the query which connects to Facebook and modify the M expression to use the new parameter instead of the static Facebook page name that was previously used.
The new parameter FacebookPage can be used on other queries. Simply refer to it in the code.
I could also apply dynamic filtering of specific columns with the new parameter. To do it I clicked on the new ABC drop down menu, and selected Parameter.
Then I could select my parameter.
After using my new parameter, I closed the Query Editor.
Power BI Desktop performed a refresh which was based on the new Current Value that I used for my parameter.
After I saved my Power Bi Desktop file, I clicked File –> Export –> Power BI Desktop.
I clicked OK in the new Export Template window (Here you can also describe your template).
The Save As window appeared. I saved my template as a .pbit file.
Now, whenever I need to create a new Facebook dashboard for a different Facebook Page, I can use this template. I click File –> Import –> Power BI Template.
After I select my .pbit file, the Enter Parameters window appears.
Here I can enter the new Facebook Page, and click OK.
Then, the new dashboard gets refreshed with the new Facebook Page.
An awesome feature!!!