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
SoledadMancilla
Regular Visitor

Conditional formatting

Hi everyone

I need help.

I am new to PBI. I need to make a table and apply conditional formattig to the column "pig" (this is the average of data for date), like this:

Green, if pig > curva

Yellow, if pig > (-) and < curva

Red, if pig < (-)

 

Captura de pantalla 2023-08-24 143320.png

And use this conditional formatting for a bar chart too.

 

This are de date:

Captura de pantalla 2023-08-24 143512.png

4 REPLIES 4
SoledadMancilla
Regular Visitor

Hi @PijushRoy 

 

But with that formula just i can use measures and my values are not a measure.

It won't let me choose the columns i need.

 

Captura de pantalla 2023-08-24 150540.png

Please use 
VAR _Pg = Selectedvalue(pg column)

VAR _minus = Selectedvalue(column)

VAR _Curva = Selectedvalue(Curva column)
Return

 Switch(
True(),

_pig > _curva,"Green",

_pig > _minus && _pig < _curva,"Yellow"

_pig < _minus,"Red")






Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Thank so much @PijushRoy for you time.

This is fine por individual values (previously achieved the same thing but in a different way), but like i say de column pig in the table is a average of de data for the date and the conditional formatting not apply for this.

2.png

3.png4.png

PijushRoy
Super User
Super User

Hi @SoledadMancilla 

Please create a measure
Color = Switch(
True(),

pig > curva,"Green",

pig > (-) && pig < curva,"Yellow"

pig < (-),"Red")

Use the proper field in above measure.

Go to conditional formating option, and use the measure as Field value
Check the article - https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting
follow Section - Color based on a calculation


Thanks
Pijush






Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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!

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.