In this blog post I will discuss how to create a Power BI template for your organisation with colour coding for different departments.
Say you want to create standard reporting template for your organisation. You have already created a custom Power BI theme with your company colours, font, layout etc and now you want to roll it out to the entire company. Your company has different departments – Finance, HR, Projects etc and you want a way to differentiate reports created by these departments. They will all use the standard Power BI theme , hence there is no differentiating factor unless you apply a different method. One way to do that is to colour code each page of a Power BI report with one colour for each department. So Finance will be colour coded blue, HR will be purple and so on. You don’t want to create multiple templates and manually create the colour codes, instead you can create a Power BI template file using parameters to drive it. Lets see how we will achieve it.
Open a new Power BI file and inside the Power Query Editor create a new list and call it Colour
Next create a parameter as follows
Next create a table with a single column and then create a custom column like this-
The table should look like this, since the parameter field is blank the Picked Department column gives null values
Hit Close & Apply and go to the Main page and create a measure
Now you are ready to apply this measure to colour code a report. Insert a text box and make it big enough that it covers the entire length of the page on the left side. Give it an appropriate width (say 65). Turn the background ON for the text box and conditionally format the colour by selecting the three dots on the top right side and apply the following formatting
You can test the template by clicking on Edit Parameters and picking the department one by one and see how the colour of the text box changes.
This template is now ready. Save this as a .pbit file and roll it out to the various departments. Any time they want to create a new report they open this template file, pick their department and the report will be automatically colour coded.