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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Amjad1002
Helper II
Helper II

How Signal Light flashing

Hello Folks,

I am trying me make my report where signal light in Red flash. I checked some old posts but it is based on HTMl files I believe.

If anyone know how to set up blinking the signal light in red would be appreciated.

Thanks

 

Amjad1002_1-1684168794172.png

 

 

 

11 REPLIES 11
Greg_Deckler
Super User
Super User

@Amjad1002 You can use SVG for that. SVG Animation - Bouncing/Blinking Stephen Few 'Red... - Microsoft Power BI Community


Follow on LinkedIn
@ 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,

I do not have xml, I am using database by using direct query.

Not sure if its still will on it?

 

@Amjad1002 The measure returns the XML that describes the SVG graphic like a blinking dot. You set the measure to be an Image URL data category and it displays the image described. 

Use SVG Images in Power BI: Part 1 - DataVeld


Follow on LinkedIn
@ 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...

Do I need to 

Microsoft Hates Greg in extral tools?

 

Hi Greg,

I am on halfway through and I am following your code. I am getting blinks just woundering if I do not have target =100 and If I have target such as >1250 how can that will work? I tried with >1250 in taget but its not working but when I do target 100 then it work.

 

@Amjad1002 So I typically control that with a Flag measure or something similar. So you create a Flag measure like:

Flag = if (sum(Sales[Sales])<[Target],1,0)

Or perhaps in your case something like:

Flag = if (sum(Sales[Sales]) > 1200,1,0)

Then this part of the SVG measure controls whether the graphic is displayed or not:

RETURN IF([Flag],__header & __shapeTextCircle & __footer,"")

So if the Flag is 1 then you display the image, otherwise just return BLANK or an empty string ""

 


Follow on LinkedIn
@ 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...

RETURN IF([Flag],__header & __shapeTextCircle & __footer,"")

 

Instead of empty I want to show Green circle without flasing. 

is that possible ?

 

@Amjad1002 Sure:

Blink = 
VAR __color = "Red"
VAR __color1 = "Green"
VAR __lineColor = "Black"
VAR __lineThickness = 1
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%'>"
VAR __footer = "</svg>"
VAR __shapeTextCircle = "<circle cx='10' cy='20' r='" & __radius & "' fill='" & __color & "' fill-opacity='" & __opacity & "' stroke='" & __lineColor & "' stroke-width='" & __lineThickness & "'> " & "<animate attributeName='opacity' from='1' to='0' dur='1s' begin='0s' repeatCount='indefinite'/></circle>"
VAR __shapeTextCircle1 = "<circle cx='10' cy='20' r='" & __radius & "' fill='" & __color1 & "' fill-opacity='" & __opacity & "' stroke='" & __lineColor & "' stroke-width='" & __lineThickness & "'> "
RETURN IF([Flag],__header & __shapeTextCircle & __footer,__header & __shapeTextCircle1 & __footer)

Follow on LinkedIn
@ 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...

It did not work,

 

Amjad1002_0-1684182157083.png

 

@Amjad1002 Remember, posting to the forums munges the HTML/XML. NOTE: In the __header VAR, you need to change the &colon; to an actual colon ( : )


Follow on LinkedIn
@ 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...

I adjusted the colon code but I am still not getting green stable traffic light. I can see red traffic light is bliking with new code. I am attached new code screenshot as well.

Amjad1002_0-1684242886505.png

Amjad1002_1-1684242910745.png

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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