Animated Tooltips in Power BI

Tooltips are always good when you wish to keep your report viewers focused on a report by providing extra information on the same page through mouse over. Although default tooltip and custom tooltips are good for showing static information, you sometimes need to show animated content like trends and behaviors based on historic data.

Recently I did an experiment with tooltips by incorporating animated content. The experiment was fairly successful as lot of viewers on LinkedIn viewed my post and requested details about how this was implemented. For those who wish to experiment tooltip I have decided to pen down steps to help enthusiasts and professionals to try animated tooltips in their reports.

Mall Traffic Image

Click here to see report in action!

For this example I have created a sample report with fictitious data to show mall traffic. Nowadays, lot of tools are available to capture mall traffic with intelligent cameras and applications to recognize type of visitors. This example assumes that data file is having records of mall visitors bifurcated based on gender and age.

I have used calculated columns and measures to create dynamic titles of visuals to behave according to the selected content. A source pbix file is also included to enhance this example further.

Visitors were classified through following table. Unicode characters were used to show respective icons.

Table: Classification

Classification Unichar
Infants 128118
Boys 128102
Girls 128103
Men 128104
Women 128105
Cars 128662

 

Mall Traffic is shown in following table assuming that data is classified based on visitor type. Additionally a column is added to show traffic in terms of cars parked in the mall parking area. This kind of example may help mall management in identifying peak parking months.

Table: Mall Traffic (Note: this is not a full list)

Year Month Boys Girls Men Women Infants Cars
2016 1 23000 19000 34000 39000 5000 800
2016 2 18900 18000 40000 42000 7000 1100
2016 3 14800 17000 46000 45000 9000 1200
2016 4 10700 16000 52000 48000 11000 1450
2016 5 6600 15000 58000 51000 13000 900
2016 6 11000 14000 64000 54000 15000 1000
2016 7 21000 17000 59000 49000 14000 1100
2016 8 31000 20000 54000 44000 13000 670
2016 9 41000 23000 49000 39000 12000 800
2016 10 23000 19000 34000 39000 5000 930
2016 11 18900 18000 40000 42000 7000 1060
2016 12 19000 22000 46000 45000 9000 1190
2017 1 10700 16000 52000 48000 11000 1185
2017 2 21000 15000 58000 51000 13000 1180
2017 3 11000 14000 64000 54000 15000 1175
2017 4 21000 17000 59000 49000 14000 1170
2017 5 31000 20000 54000 44000 13000 1165
2017 6 41000 23000 49000 39000 12000 1160
2017 7 11000 15000 58000 51000 13000 1200
2017 8 11000 14000 64000 54000 15000 1215
2017 9 21000 17000 59000 49000 14000 1230
2017 10 31000 20000 54000 44000 13000 1245
2017 11 41000 23000 49000 39000 12000 1260
2017 12 23000 19000 34000 39000 5000 1000

 Model Diagram

Model Diagram below is showing relationship between two tables used. I have used additional columns and measures to perform analysis. Tables were transformed through edit query to make it analysis friendly. You may find query editing steps in sample pbix file.

Mall Traffic

 Play Axis Visual

I have used “Play Axis” custom visual to create animation on tooltip pages (You can import the same from the marketplace).  It was deliberately kept behind the clustered bar chart to work in background. “Year” column was selected in the field well to run tooltip based on years. In other tooltips, I have also used visitors’ classifications for animation.

PlayAxis Tooltip

Following settings were done in the format section of “Play Axis”.

PlayAxis Tooltip2

Calculated Columns and Measures

Following calculated columns were used for different reasons.

Calculated columns for creating icons

UnicharIcon = UNICHAR(Classification[Unichar]) 

Measures used for dynamic titles of different visuals and tooltips. These measures show values based on selections made through “Play Axis”.
AllYears = CONCATENATEX(VALUES(MallTraffic[Year]),MallTraffic[Year],” | “, MallTraffic[Year])
AllClassifications = CONCATENATEX(VALUES(MallTraffic[Icon]),MallTraffic[Icon], “| “)
AllClass = CONCATENATEX(VALUES(MallTraffic[VisitorClassification]),MallTraffic[VisitorClassification],” | “)
How to see animated tooltips.
Following visuals (marked with red arrows below) were configured for tooltips. You can check with mouseover to see tooltips in action. Keep holding your mouse to see animation effects. For cards, you have to keep your mouse over the figures and for line chart, keep mouse over the required node.
tooltips
This document is not covering method for creating tooltips as this is assumed that you are aware of the normal procedure of creating tooltip pages.
Following picture indicate how you can associate tooltip with your visual. However, you have to be sure that the field(s) used in your visuals are used in your tooltips otherwise it will not work.
tooltipsconfig
You may download complete files including sample Excel file from the following link.
Keep following my blog for more exciting examples.

Using Unicode Characters in Axis and Slicers

I recently did an experiment with Power BI report by using “Unicode characters” which was shared on LinkedIn. In this example I used selected characters in slicers and axis instead of text. This has created lot of interest among followers and received numerous requests to share details.

In reality it is a fairly simple approach where different Unicode characters were selected for different items and reactions used in this example.

Snapshot

Following three tables were created in Excel which were used in this report. For each dimension table I have added Unicode to represent icon.

Table Name: Serving

Item code Item Unichar
100 Coffee 127854
101 Ice Cream 127846
102 Soup 127861
103 Pizza 127829
104 Donuts 127849
105 Burger 127828

 

Table Name: Reaction

Rcode Reaction Unichar
1 Smiley 128578
2 Sad 128542
3 Neutral 128528
4 No Feedback 128566

 

Table Name: Responses (Only few rows shown here. Check Excel file for full list)

ItemCode Rcode
100 1
100 1
101 1
101 2
101 2
101 3
101 3
101 3
101 4
101 4
101 4
101 4
101 1
101 1

After importing excel sheet in Power BI I have added couple of calculated columns and measures. To create icon I have used following DAX.

For Item Icon to be used for Axis

ItemIcon = UNICHAR(ItemDefinition[Unichar])

 

For Item Icon and name to be used for slicer

IconAndItem = ItemDefinition[ItemIcon] & UNICHAR(10) &  ItemDefinition[Item]

 

Similar is used for calculated column for Reaction icon.

ReactionIcon = UNICHAR(ReactionDefinition[Unichar])

 

For Reaction Icon and name to be used for slicer

IconAndReaction =
ReactionDefinition[ReactionIcon] & UNICHAR(10) & ReactionDefinition[Reaction]

 

Following is the snapshot of relationship.

Model Snapshot

You may download sample excel file and PBIX file to evaluate more. This example is just to show how you can implement Unicode character. There can be numerous implementations and scenarios where icons can add value to your visuals and keep your report simple to grab the information easily.

To download only Excel file click the following link ReactionData

Complete files including PBIX can be download through  the following link

Unichar Example from EZPowerBI.com

Click here to see report in action View Power BI Report

For finding appropriate Unicode characters check the following links.

http://xahlee.info/comp/unicode_index.html 

https://www.vertex42.com/ExcelTips/unicode-symbols.html

Will be sharing more examples in future.

Subscribe to my blog for more surprises!

Cheers!