In my recent talk for PASS BA Marathon, I showed few formatting tricks in Power BI with my super slow laptop. I promised to write a blog post but due to some other priorities, I didn’t manage to publish this blog post in time, well better late than never!
You can watch recorded Session here:
or just some highlights here:
Adding Gif images to Power BI:
People who knew me in person, I am sure they know I like pictures. However, so many pictures on a dashboard are undoubtedly not a good idea. Stephen Few mentioned, “Art has its place but not on the Dashboard”. Here, I am not at all recommending to put loads of GIF’s on the dashboard, but if you want to go crazy with your dashboard or want to get people attention, it’s not a bad idea. Well as Stephen Few mentioned in another article, It’s nice to highlight what needs attention.
Adding GIF images is quite easy. First I created a measure with value 0. I named this measure as BGGif, so I know I have to hide it from users, and it will be easy to identify in the model. It is not mandatory to create a measure, you can use an existing one, but creating a separate one makes it easy. Then I placed Line Chart( you can use other charts, but Line Chart makes it a bit easy). Then I went to format options of Line Chart, under Plot Area, for Add Image option I chose the GIF image. Based on the data colours, there is a chance of spotting a Lil dot; if you don’t want it, just move BGGif value to tool tips. I like the idea of putting Gif images; you can create some cool ones like below 🙂 I read or heard using Plot Area of charts for gif images, I don’t remember where exactly it was. Whoever it was, thank you 🙂
There are several ways we can do this based on our use case. In my demo, I just wanted to show a background in green if the price <=100 if not Red.
First I created a measure with a bit of DAX. Again, I am going to prefix it with BG and make sure I hide it for business users.
PriceBG = if([Sum Of Price]<=100,"http://cdn30.us1.fansshare.com/image/wallpapergreen/pix-for-gt-plain-mint-green-wallpaper-mint-green-plain-background-wallpaper-wallpaper-mint-green-999507947.jpg" , "http://www.publicdomainpictures.net/pictures/200000/velka/plain-red-background.jpg")
In the measure, it is just a URL with Red and Green backgrounds. I changed the data category of measure to Image URL. Then I used Image custom visual to display PriceBG measure. One problem with this approach is if URL brakes, visuals will not work.
I first saw this technique when Will Thomson showed at UK Power BI Summit also recently Chris Webb blogged about using Unichar() function. In my demo, I just copied Emoji’s from the Web and placed them in my measure, but if you want you can use UNICHAR() function as Chris explained.
To show #Beds – I created a measure like below:
#BedsEmoji = if((AirBnB[bedrooms])>=5,"🛏️ +",
IF(AirBnB[bedrooms]=3,"🛏️ 🛏 🛏️️",
IF(AirBnB[bedrooms]=4,"🛏️ 🛏️ 🛏️ 🛏️","0")))))
And for an overall review, I used Sentiment Analysis, based on sentiment analysis value; I created another measure:
ReviewEmoji = if(SUM([Score])<=.50,"😨","😁")
These emoji looks great on Power BI Service than PowerBI Desktop. I love the functionality of using strings in DAX measures, it enables us to use Unicode and advantages are unlimited. As I blogged in one of my previous blog posts, you can use these to highlight a specific data point in a chart. Or as Chris blogged, we can use Unicode in many ways.
Hope this blog post gives you some ideas, and again I am sorry for not publishing blog post earlier. You can download the PBI file here – https://1drv.ms/f/s!Avm7gbgZtlMlpx4qFeK1Qu15NcpE and view reports here – https://app.powerbi.com/view?r=eyJrIjoiNzUxYzRmNjUtNDA4Mi00MWI0LWJiNWQtMDRiZWQwZmFjYjE0IiwidCI6IjM4YmU3MjU5LTMyMGQtNDZkYy04YzNiLWNkZDA5OTM1NGExMyIsImMiOjh9