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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to paint the label of a chart depending of other column of my data

Hi everyone,

 

I have this chart: 

Gustavo98_0-1682621309443.png

 

This are prices that i have in a excel, this prices can be normal price or promotional price, to distinguish that situation i want to paint (not manually) the laber yellow if it is promotional price, if not let the label white.

 

How can i do that fast?

 

Ty vry much everyone!

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

According to your description, you want to " paint the label of a chart depending of other column of my data".

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1682926974868.png

(2)We can create a measure like this:

Measure = var _flag = MAX('Table'[Flag])
return
IF(_flag =  "promotional price","#FFFF00","#FFFFFF")

(3)Then we can put this measure on the "fx" of data Label's font color:

vyueyunzhmsft_1-1682927053162.pngvyueyunzhmsft_2-1682927064257.png

Then we can get the result as follows:

vyueyunzhmsft_3-1682927081511.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

According to your description, you want to " paint the label of a chart depending of other column of my data".

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1682926974868.png

(2)We can create a measure like this:

Measure = var _flag = MAX('Table'[Flag])
return
IF(_flag =  "promotional price","#FFFF00","#FFFFFF")

(3)Then we can put this measure on the "fx" of data Label's font color:

vyueyunzhmsft_1-1682927053162.pngvyueyunzhmsft_2-1682927064257.png

Then we can get the result as follows:

vyueyunzhmsft_3-1682927081511.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Anonymous
Not applicable

Ty vry much it worked perfectly!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.