Tickers are useful when you want to show information in floating form. Almost everyone is used to ticker like visuals in reporting as in situations like stock exchange information, game scores, weather report, news headline or otherwise tickers are fairly useful.
Click here to see report in action.
In Power BI we have limited possibilities of animated content like tickers. In order to produce ticker like visual, I have tried two different approaches.
- Using Card Visual and Play Axis Custom Visual
- Using SVG through HTML Viewer Custom Visual
Using Card Visual and Play Axis Custom Visual
In this method I have created different custom columns and measures.
“What if parameter” was used to create a table to help in animation of the text.
Length = GENERATESERIES(0, 150, 1)
“Ticker” measure was used to create content for ticker which will run from left to right. DAX REPT was used to create empty spaces on the right side as card visual always keep text in center. While next measure “LeftToRightTicker” will add spaces to the left of the ticker content based on changing values of “Length Value” in response to Play Axis visual. You can set play axis animation settings based on your needs.
Ticker = CONCATENATEX(VALUES(Outlets[CityOutlets]), Outlets[CityOutlets], ” | “) & REPT(” “,60)
LeftToRightTicker = REPT(” “, Length[Length Value]) & [Ticker]
Play Axis visual was used to change values in Length table created through “What if parameter”.
Using SVG through HTML Viewer Custom Visual
In SVG example, HTML is generated through custom columns for both simple and TV like visual. A custom column “Ticker” is used to create concatenated text for use in ticker which is ingested in the HTML to produce ticker.
SVGContentSimple = “<svg width=””100%”” height=””100″” style=””background: white””>
<text x=””10″” font-size=””10pt”” y=””50″” fill=””black”” >” & SummaryTable[Ticker] & ”
<animate attributeName=””x”” from=””-120%”” to=””120%”” dur=””25s”” repeatCount=””indefinite”” fill=””freeze”” >
Source file can be reviewed for more details. Click here to download.
Reference for SVG images used in this example http://thoughtbot.github.io/foundry/