Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
betsyvimal
Regular Visitor

Blinking/Flashing data in power bi

Is it possible to blink or flash data absed on a specific condition.

 

For eg: I am building a report to track status of a bunch of processes. I need to flash a process if its at risk to draw attention. I could sue conditional formatting to display a specific color in such situations but the cocnern is there are large number of processes and a lot of statuses associated. The ones at Risk need immediate attention so a blinking image or icon could help.

 

Is this posible,

1 ACCEPTED SOLUTION

I posted it to the the Quick Measure gallery here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Bouncing-Blinking-Stephen-Few-Red-Dot/m-p/51...

 

You can download the PBIX file to see it in a visual.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

8 REPLIES 8
grimnortherner
Regular Visitor

Hello,

 

We tried the solutions in this post and found they are more suited to adding lots of shapes as a column in a table.

 

Great solutions, but we were looking for something slightly different - just making a blinking shape, that responds to changes in data, which can be placed as an object on top of a map. In case anyone is looking for this, I've laid out our method below.

 

Note that this won't be suitable for some environments; it works in Power BI Desktop with the .pbix file open, which is exactly what we needed. For a published report in the web browser, you will find that the auto refresh rate might be automatically adjusted (particularly if you're not using Premium) and the image won't blink as quickly as this.

 

1. Define a measure to make a colour change, in response to current time:

BlinkGreen = calculate(if(mod(second(UTCNOW()),4)>1,"#90ee90","White"))
The hex code above is equivalent to 'Light Green' if you prefer this.
This measure will lead to a shape that changes colour (roughly) every 2 seconds.
 
2. Add your shape / visualisation, e.g.
- insert -> shapes -> choose your favorite!
- add e.g. a bar chart or anything that allows conditional formatting
 
3. Apply conditional formatting, e.g.
- click on 'fx' button next to Fill or Outline
grimnortherner_1-1632751092573.png

- Format by = Field Value; Based on field = BlinkGreen [or whatever you called your measure]

grimnortherner_2-1632751281407.png

4. Configure your colours

- instead of pointing to a fixed hex code as above, you can now point your 'Blink...' measure to alternative measures or column results, so that the blinking colour will respond dynamically to your data. 

- e.g. we used a 'StatusColour' measure to make some statuses show as green and others red [there's lots of posts on how to do this already]; we then replaced the hex code in the above 'BlinkGreen' measure with this 'StatusColour' measure, to make a 'BlinkStatus' measure

BlinkStatus = calculate(if(mod(second(UTCNOW()),4)>1,[StatusColour],"White"))

- tip: when formatting a shape, we used the 'StatusColour' measure for the outline, and 'BlinkStatus' measure as the fill colour - so the outline stays solid but its colour always matches the blinking centre

 

5. Set auto refresh

- select the background of your page, go to formatting, set Page refresh = On, set refresh to once per second

grimnortherner_3-1632752080915.png

 

You should now have a blinking shape! 😸

TomMartens
Super User
Super User

Hey,

 

I guess you can use some of the svg data visualizations, you can a more detailed description how to use svg in a table or matrix visual here:

https://community.powerbi.com/t5/Quick-Measures-Gallery/SVG-Microchart-Harveyball-and-Harveybox/m-p/... or here

https://community.powerbi.com/t5/Quick-Measures-Gallery/SVG-Sparklines-Categorical-Columns/m-p/48953...

 

This measure (don't forget to set the data category to image url):

dancing donut = 
var svgChart = 
"data&colon;image/svg+xml;utf8,<svg 
xmlns:dc='http://purl.org/dc/elements/1.1/'
   xmlns:cc='http://creativecommons.org/ns#'
   xmlns:svg='http://www.w3.org/2000/svg'
   xmlns='http://www.w3.org/2000/svg'
   width='100%' height='100%' viewBox='-4 -4 8 8'>
 <title>SVG animation using SMIL</title>
 <circle cx='0' cy='1' r='2' stroke='red' fill='none'>
  <animateTransform
   attributeName='transform'
   attributeType='XML'
   type='rotate'
   from='0'
   to='360'
   begin='0s'
   dur='1s'
   repeatCount='indefinite'/>
 </circle>
</svg>
"
return svgChart

creates a moving donut, basically you can use any animation you can create with pure css/svg.

 

dancing donuts.gif

From my point of view motion should be used sparingly to avoid diverson, but also provides the means to direct attention.

 

Hopefully this provides you an idea.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you for the response Tom. I ll take a look at the details you ve shared

Here is a blinking dot:

 

Measure 2 = 
VAR __color = "Red"
VAR __radius = 9
VAR __opacity = 1
VAR __rand = RAND()
VAR __header = "data&colon;image/svg+xml;utf8," &
              "<svg 
                xmlns:dc='http://purl.org/dc/elements/1.1/'
                xmlns:cc='http://creativecommons.org/ns#'
                xmlns:svg='http://www.w3.org/2000/svg'
                xmlns='http://www.w3.org/2000/svg'
                width='100%' height='100%'>
                <title>SVG animation using SMIL</title>"
VAR __footer = "</svg>"
VAR __shapeTextCircle = "<circle cx='10' cy='20' r='" & __radius & "' fill='" & __color & "' fill-opacity='" & __opacity & "'> " & "<animate attributeName='opacity' from='1' to='0' dur='1s' begin='0s' repeatCount='indefinite'/></circle>"
RETURN __header & __shapeTextCircle & __footer

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you for the response. Greg.

 

 

Is there a way you could show me how to use it in a visualization tool? Sorry I am new to Power BI and might be missing a basic information.

I tried to display it on couple of visualizations but its shows the code within the Measure. I changed the data type to multplie different type but dint help.

I posted it to the the Quick Measure gallery here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Bouncing-Blinking-Stephen-Few-Red-Dot/m-p/51...

 

You can download the PBIX file to see it in a visual.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

Good day! Is there a prerequisite in making this work? I downloaded your .pbix, tried a few things (like removing some properties or the if part) and it works right away but when I paste it as a measure in my own project, the matrix shows the code inside VAR_HEADER instead of the dot.

Thanks in advance!

Sorry, forgot to set data category to image URL. Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.