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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to make a Card Text Blink

Hello All,

I am trying to create a card that uses a measure and if negative it blinks Red if positive its just normal black text.

 

All my reading says to HTML or CSS but not entirely sure how to do this.


Can any one help me please?

Thank you!

1 ACCEPTED SOLUTION

HI @Anonymous

For flashing text, you could construct HTML or SVG and use the HTML Content (Lite) custom visual.

 

I have attached a small example where I defined the content for the "card" as an SVG.

The measure is as follows:

Profit $ SVG = 
VAR MeasureValue = [Profit $]
VAR MeasureSign = SIGN ( MeasureValue )
VAR MeasureFormatted =
    FORMAT ( MeasureValue, "#,##0;(#,##);-" )
VAR TextColour =
    SWITCH (
        MeasureSign,
        -1,
        "red",
        "black"
    )
VAR AnimationTag =
    SWITCH (
        MeasureSign,
        -1,
        "<animate attributeName='opacity' values='1;0;1' dur='1s' repeatCount='indefinite' />",
        ""
    )
VAR SVG_String = 
        "<svg viewBox='0 0 300 80' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid meet'>
        <text x='50%' y='50%' font-family='DIN' font-size='50' fill='" & TextColour & "' dominant-baseline='middle' text-anchor='middle'>"
        & AnimationTag & MeasureFormatted & "</text></svg>"
RETURN
    SVG_String

Blinking visual.gif

 

The formatting would likely need to be adjusted to meet your needs but this should be a start at least 🙂

 

Regards

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

Power Bi's visualizations don't support embedding custom HTML or CSS code, so card visuals can't be set directly with CSS or HTML.
Irwan's reply can be used as a workaround for your reference.

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Irwan
Super User
Super User

hello @Anonymous 

 

first, create the measure for color conditional formating.

Color Palette = 
IF(
    'Table'[Nom]<0,
    "#FF0000",
    "#000000"
)

next, in your card visual option, go to "Callout value" option. then choose conditional formating.

Irwan_0-1723524431226.png

choose Field Value in Format Style.

Irwan_2-1723524633308.png

then, select the measure in field.

Irwan_3-1723524679396.png

press OK

 

here is the result.

negative

Irwan_4-1723524716081.png

positive

Irwan_5-1723524738348.png

 

Hope this will help you.

Thank you.

 

Anonymous
Not applicable

Do you know how to get it to blink or flash, please?

hello @Anonymous 

 

i have never seen a blinking or flashing color in conditional formating since it is color or icon selections.

But the others might know.

 

Thank you.

HI @Anonymous

For flashing text, you could construct HTML or SVG and use the HTML Content (Lite) custom visual.

 

I have attached a small example where I defined the content for the "card" as an SVG.

The measure is as follows:

Profit $ SVG = 
VAR MeasureValue = [Profit $]
VAR MeasureSign = SIGN ( MeasureValue )
VAR MeasureFormatted =
    FORMAT ( MeasureValue, "#,##0;(#,##);-" )
VAR TextColour =
    SWITCH (
        MeasureSign,
        -1,
        "red",
        "black"
    )
VAR AnimationTag =
    SWITCH (
        MeasureSign,
        -1,
        "<animate attributeName='opacity' values='1;0;1' dur='1s' repeatCount='indefinite' />",
        ""
    )
VAR SVG_String = 
        "<svg viewBox='0 0 300 80' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid meet'>
        <text x='50%' y='50%' font-family='DIN' font-size='50' fill='" & TextColour & "' dominant-baseline='middle' text-anchor='middle'>"
        & AnimationTag & MeasureFormatted & "</text></svg>"
RETURN
    SVG_String

Blinking visual.gif

 

The formatting would likely need to be adjusted to meet your needs but this should be a start at least 🙂

 

Regards

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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