But if we don’t even know that these other options exist, then it wouldn’t even occur to us to reach for them. In this article, I deliberately do not focus on “pseudo templates”, by which I mean, for example, DAX code templates for SVG generation, etc. However, if you are interested in some examples, you can find a few useful ones here.
But back to those that interest us and can help us create content faster that will be uniform within our organization or that will standardize the connection to some data source.
In such cases, most of us think of the mentioned “.pbit”, which I will come back to later, but files of the type “.pbix” and “.pbip” can serve just as well. But what about the often overlooked “.pbids” format? Let’s face it: who among us has ever created this file, and who regularly uses it… There are exceptions, but I’m often met with raised eyebrows when I mention this ending. The possibility of using templates directly in Power BI Service / Microsoft Fabric to facilitate the production of reports in an online environment and support Self-Service over Golden Semantic Models (Dataset).
To look at them in more detail, I need to make a division that will help categorize them a little better:
- Visual templates = Templates focusing on the visual side of the output. They do not contain a description of how the data is to be handled.
- Data templates = Templates focused only on working with data, how to connect to a specific data source, and what transformations must be performed.
- Combined = Templates containing elements from both mentioned above.
Wait, there are so many templates in Power BI that it needs to be split like this? Yes! So, let’s start from the beginning.
Visual templates
As mentioned, these templates carry specific reusable settings for the visual layer. But they don’t carry data. In such a case, developers/users usually come across “.json” files with Theme definitions for reports.
Theme templates
It is a “.json” file you can export from any Power BI file. For some time now, Power BI Desktop has also included a relatively practical editor that enables basic editing of this template.
Theme template editor in Power BI Desktop
But as the Microsoft repository on GitHub reveals, much more can be defined within this template than just the basic palette of colors, backgrounds, and fonts. It is possible to add your own icon sets for conditional formatting and make specific settings for individual types of visuals so each can be completely ready for its purpose from the start.
Luckily, we don’t have to learn this “.json” fully because community editors created that can make your work very easy. Each of them has a slightly different ability and price tag (some are free, of course)
These templates are helpful; using them to make your work easier and not having to set up each visual / color separately is a good idea.
Online templates
Do you need help finding this option? There are also templates within Power BI Service / Microsoft Fabric. They are always connected to precisely one semantic model, which means that if you want to use them, you need to create/connect them to individual semantic models where they can be used. Imagine an average Power BI Report in the Power BI Service, offered as a template if you are trying to create a new report from an existing semantic model.
Online template in Semantic model details
Do you need help finding this option for yourself? This is entirely normal. You need to set up a report as a template to see this option. It’s complicated? Not at all! You select the report that the template should behave in and then add the suffix “(Template)” to its existing name. So, the resulting name will look something like this:
Name: HR Reporting (Template)
Name of templated report
The option above is unblocked as soon as Power BI Service / Microsoft Fabric registers the presence of this suffix in a report connected to this semantic model. This online report template behaves similarly to the “.pbit” template without carrying information about transformations because a Thin Report is created when used. BEWARE of what kind of information we show in these reports because they will constantly be recreated, so we should leave only the necessary elements in them, or preset visuals, in which you can change the data and work straight away.
So now we know how to create them. But should I use them? Yes, but only sometimes. Although this feature is interesting, its full use depends on your concept and direction of Power BI in the company. They can help you the most if you want to provide online users with the opportunity to create standardized reports based on pre-made semantic models. At such a moment, however, it is also a good idea to mark these models in such a way that it is possible to identify this possibility without the need to open every single semantic model and find out whether it can train users that they can expect something like this in specific scenarios and work with it.
Data templates
In these templates, I include those that manipulate data in some way or allow this manipulation and can be reused for the same or a similar purpose. At the same time, I do not mention “.bim” files here, which could be taken similarly after certain modifications.
PBIDS Files
However, these files are only encountered by a few users or developers. At the same time, these are convenient files that Power BI developers can use to facilitate the initial work when connecting data from sources.
Inner structure of PBIDS file
The PBIDS file contains information about which “connector” should be used for the data within the JSON notation, and you can directly specify, for example, the database server + a specific database. So, the Developer only needs to log in.
Developer log-in in PBIDS
Connecting to data is elementary knowledge. Do we need template files for this? Yes, but also no.Of course, there are cases where this may not need to be needed if I’m connecting to a source whose connector is named the same as it. On the other hand, the relief of not remembering the name of the database server, let alone the name of the database from which I have to take the data as a result, is quite pleasant. I would put it in a slightly different analogy: how many of us remember the address of the virtual machine we connect to? How many of us were very happy that we didn’t even have to enter it in the beginning (before the app finally saved it) because we received a file from which the import was made into the appropriate RDP application?
If I add that applications/systems could generate these files immediately, and thus you don’t even have to think about what data layer was used, I no longer need to promote this type of template.
Do you know that, for example, these files can be generated within Azure SQL Database? Your Azure SQL Database -> Power Platform -> Power BI –> Get started
Azure SQL - Visualize in Power BI
Great. How about instructing your in-house system developers to prepare such generators for you? It’s not complicated! All about them can be found here: Power Query Templates In Excel And Fabric
Model.json
What is it? If you’ve ever created Dataflows Gen 1, you’ve probably noticed the option to export as JSON. If you click on it, you get a “.json” file that starts with the name of your dataflow, and after opening it, you find out that, in addition to the M code, it also contains a lot of names, labels, and settings that apply to the given dataflow.
Okay, okay, but why did I name it “model.json”? This is again a slightly more branched answer: “Each Dataflows Gen 1 stores two types of files - CSV + JSON - in the subordinate Storage Account gen 2. These types maintain the produced data (CSV) in snapshots and metadata (JSON), as you get for calling export to a JSON file. Snapshots are also maintained for these metadata, but the main one, or the currently used one, is named modej.json, so that’s why.”
If Dataflows Gen 1 stores data in your Storage Account and you can access these files, you can make changes in the dataflow without having to make them through the Power Query Online environment. However, snapshots of “model.json” are not created at that moment; be careful! You can damage the entire data, and support will not be able to help you. So it’s at your own risk.
And why am I ranking this as a template? That’s easy! These files can subsequently be used to create a new Dataflow Gen 1. Select the import from json option in the first window.
Import from JSON
Don’t worry; the system is smart enough not to overwrite existing dataflows, but it will start creating a number series with the given name.
Power Query Templates
The last of these templates is a Power Query template. This is something we know, for example, from Excel or Dataflows Gen 2. A particular file can be exported, carrying the M code to be applied. So far, this type of template can only be used in some places, like in Dataverse Dataflows.
Initially, I had planned to write a bit more about this type of template, but recently, there was a great article that describes them, so here is the link: Power Query Templates In Excel And Fabric by Chris Webb or here you can find article from Nikola Ilic What is a Power Query Template and why it’s a big deal in the era of Fabric?.
Combination templates
So now we are finally getting to the level of not only dealing with the visual or data level. These templates allow you to prepare both. Of course, I will mention the variants only for users with access to Power BI Desktop.
Power BI Template Files (PBIT) + Power BI Projects
This file type contains the following:
- Report pages, visuals, and other visual elements.
- The data model definition includes the schema, relationships, measures, and other model definition items.
- All query definitions include queries, parameters, and other query elements.
This allows us to prepare complete reports along with connections to source systems and provide this file to users so they can get ready answers exceptionally quickly.
PBIT: When opening them, the user must fill in the individual mandatory parameters and log in to the data sources. Once this is done, the data will be obtained and transformed, and the report will be rendered. It is purely a template file type.
PBIP: Power BI Project is the latest addition to the family of Power BI files, which stores individual background files in a readable and versionable form. This means that the use is not only for templates but for any development that should be versionable.
The advantage of these files is that you can prepare everything necessary and save the result without data. But this may only be desirable in some scenarios… in such moments, we can reach for the PBIX files themselves, which can serve us just as well.
Community solution
The community works with various of these templates regularly, resulting in many solutions you can use to create customizations of these templates. I have chosen some that are the most practical. (I certainly don’t know all that exists.)