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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
UncleLewis
Responsive Resident
Responsive Resident

Set Reference Label Background Color Conditionally

Hi all,

Using PBID Oct, 2024.

How can I set the color just behind the Reference Label of the KPI Card New?
I added my DAX to background of the reference label, but that turned the entire reference label area a muted red,
I want the color to be only behind the text of the reference label.

PBIX is here

ref lbl color.png

Thanks,

-w

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @UncleLewis 

You are unable to provide the desired background to the label text only because, from the engine's perspective, the label ref is considered the entire area of the region, not just the text itself.

As a workaround, what you can do is detach the background color from the card and create a rectangle with conditional formatting settings using the DAX you created. This way, you will get a result like in the picture.

Ritaf1983_0-1729057000052.png

The modifications that I did to achieve :
1. Create a rectangle with your dax measure as a fill color :

Ritaf1983_1-1729057090407.png

2. put it on back of the card:

Ritaf1983_2-1729057137173.png

3. switch off the card background

Ritaf1983_3-1729057213054.png

4. Group

Ritaf1983_4-1729057244474.png

Note that the rectangle's size is not dynamic, so if the string can change in length, the rectangle should account for this in its length in advance

The pbix is attached 

 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

TomMartens
Super User
Super User

Hey @UncleLewis ,

 

This is not possible; the background color for the reference label is coloring the entire area of the reference label.

 

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

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @UncleLewis ,

 

This is not possible; the background color for the reference label is coloring the entire area of the reference label.

 

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
Ritaf1983
Super User
Super User

Hi @UncleLewis 

You are unable to provide the desired background to the label text only because, from the engine's perspective, the label ref is considered the entire area of the region, not just the text itself.

As a workaround, what you can do is detach the background color from the card and create a rectangle with conditional formatting settings using the DAX you created. This way, you will get a result like in the picture.

Ritaf1983_0-1729057000052.png

The modifications that I did to achieve :
1. Create a rectangle with your dax measure as a fill color :

Ritaf1983_1-1729057090407.png

2. put it on back of the card:

Ritaf1983_2-1729057137173.png

3. switch off the card background

Ritaf1983_3-1729057213054.png

4. Group

Ritaf1983_4-1729057244474.png

Note that the rectangle's size is not dynamic, so if the string can change in length, the rectangle should account for this in its length in advance

The pbix is attached 

 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors