top of page
Writer's pictureOscar Martinez

Having a Light and Dark version of your Power BI Reports.

Updated: Feb 1

“It was the possibility of darkness that made the day seem so bright.” — Stephen King.


The case for having Power BI Light and Dark versions.

For a couple of years, we’ve seen a boom in applications supporting dark versions of their interfaces, and Power BI is not the exception. Creating a dark, light version of analytics reports can benefit business intelligence developers:

Accessibility: dark versions of reports can facilitate reports consumption and improve accessibility for those with visual impairments to consume reports more efficiently

Users' preference: dark mode can also provide a more aesthetically pleasing experience for users, making it more enjoyable to interact with the report.

Create a modern and attractive UI/UX for users with a range of preferences

In Power BI, there are three main approaches for creating these two versions of your reports, and, like almost everything in this life, choosing any method means opportunities and compromises; let's dive through them:

First (preferred) approach: JSON Themes.

You can achieve your report's dark and light versions by applying report themes. Using a theme is very easy and doesn’t take more than a couple of seconds and clicks to apply one.

Two different JSON themes and two PBIX files must be created, each with a different theme. In this case, the toggle button has a Web URL action that directs the user, in a new tab, to the other version of the Power BI report.

When I first wrote this post a couple of years ago, creating themes was something time-consuming and required some knowledge of JSON structures. Thanks to BIBB's Power BI Theme Generator, this is done in a breeze today.



✅ Pros:

  • Applying themes is as quick as a finger snap.

  • No need for complex bookmarks.

  • Replicable approach.

  • Fine control of elements

❌ Cons:

  • Change between modes happens by navigating to a different report.

Second approach: DAX

Since the first time I wrote this article, there has been a lot of exploration of creating Power BI files with both modes, and one method has been gaining traction: the DAX one.

The DAX method uses conditionally formatting Power BI visuals based on DAX formulas; the measures created require switching the HEX colours based on a selected parameter. As with all DAX subjects, there is no single approach, and different DAX functions can be used to achieve the result.

This method is very time-consuming and not bulletproof, as many visuals have properties that cannot be conditionally formatted.

Below, you will find some good resources about how to achieve this DAX method:

✅ Pros:

  • DAX is straightforward and not complicated.

  • Switch between modes in the same report.

❌ Cons:

  • Not easily replicable.

  • Conditional formatting needs to be applied to every visual.

  • Time-consuming.

Third approach: Duplicate items.

Two versions of a Power BI visual
Creating two versions of each item in the same report is the least recommended approach.

You must make two versions, dark and light, of almost every element and visual on your report. Also, you have to add a box covering all the report’s areas acting as the alternative background; these elements need to be hidden and unhidden through bookmarks, which need to be assigned to buttons.

This approach is suitable for newbies in Power BI as there is much learning potential in the Visual formats and Bookmarks management area.

Like the DAX approach, I would not recommend this one for the busy BI professional, mainly because it is time-consuming.

For more information about making buttons and bookmarks, refer to this great video from Guy in a Cube: Power BI Bookmarks, Selections and Toggles - YouTube

✅ Pros:

  • You can do it all within Power BI desktop.

  • No need to learn JSON structures.

  • Quicker to make changes on the fly.

  • The transition between modes happens within the same report.

❌ Cons:

  • Not easily replicable.

  • Challenging if you have many bookmark interactions.

  • The transition between modes happens to navigate to a different report.

  • Time-consuming.

Conclusion

It is probably not hard to guess that my preferred option is the second one; regardless of your chosen method, my only suggestion is that when creating your reports, always keep your end-users in mind and always make your best effort to make the experience of using your report a pleasant one.

1,886 views

Comments


bottom of page