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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
evano_oruvan
Frequent Visitor

conditional formatting based on text from data object on target column

evano_oruvan_0-1662818433349.png

 

i have this legend and a column named target in pbi, i would like to create conditional formatting based on data objects text and values and apply to that target column,

 

questions

1.how to create conditonal formatting based on text, tried isselcted could not get answers, please help for the above legend

2. is it possible to use measure for column without aggregation for conditional formatting.

 

thank you.

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Try this ....

 

Click here to download a solurtion 

 

speedramps_0-1662829687569.png

How it works ...

 

Create a target table ...

 

speedramps_1-1662829784363.png

 

 

Creates an actutals table

speedramps_2-1662829815979.png

 

Build relationship

speedramps_3-1662829842305.png

 

Create dax measures

Green RAG = "green"
Amber RAG = "orange"
Green RAG = "green"

 

Actuals RAG =
var greentarget = SELECTEDVALUE(Targets[Green])
var redtarget = SELECTEDVALUE(Targets[Red])
var actual = SUM(Acutals[Amount])
RETURN
SWITCH( TRUE(),
actual >= greentarget, "Green",
actual < redtarget, "Red",
"Orange"
)
 
On the actuals visual clcik on the column
In conditiomal formating select background colour 
Format style = filed value / based on field =  Actuals RAG

 

 

speedramps_4-1662830141005.png

 

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @evano_oruvan ;

You could create a measure as follow:

Measure = IF(SUM('Table'[target])>=RIGHT(MAX('Table'[green]),2)+0,"Green",
          IF(SUM('Table'[target])<RIGHT(MAX('Table'[red]),2)+0,"Red","yellow"))

then  set conditional format.

vyalanwumsft_0-1663034327454.pngvyalanwumsft_1-1663034354892.png

The final show:

vyalanwumsft_2-1663034377277.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

speedramps
Super User
Super User

Try this ....

 

Click here to download a solurtion 

 

speedramps_0-1662829687569.png

How it works ...

 

Create a target table ...

 

speedramps_1-1662829784363.png

 

 

Creates an actutals table

speedramps_2-1662829815979.png

 

Build relationship

speedramps_3-1662829842305.png

 

Create dax measures

Green RAG = "green"
Amber RAG = "orange"
Green RAG = "green"

 

Actuals RAG =
var greentarget = SELECTEDVALUE(Targets[Green])
var redtarget = SELECTEDVALUE(Targets[Red])
var actual = SUM(Acutals[Amount])
RETURN
SWITCH( TRUE(),
actual >= greentarget, "Green",
actual < redtarget, "Red",
"Orange"
)
 
On the actuals visual clcik on the column
In conditiomal formating select background colour 
Format style = filed value / based on field =  Actuals RAG

 

 

speedramps_4-1662830141005.png

 

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

Greg_Deckler
Community Champion
Community Champion

@evano_oruvan You would have to create a measure that returns a numeric value based on the text value. You have to use aggregation in measures that refer to columns but often you can use MIN or MAX and that works just fine.



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.