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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JUAN_1969
Helper I
Helper I

Formato condicional por objetivo

Muy buenas.

Estoy intentando crear una medida para poder aplicar formato condicional en función de una serie de condiciones.

Por simplificar, tengo una tabla con dos columnas, una provincia y otra venta. Cada provincia tiene un objetivo distinto de ventas. Y me gustaría poder dar formato condicional a cada provincia si han alcanzado o no el objetivo de ventas.

Esta podría ser la tabla


PROVINCIA

VENTAS

  
 

enero

febrero

marzo

SEVILLA

1000

700

900

GADITANA

5000

4000

3000

MÁLAGA

3000

2500

350

JAÉN

1500

100

2100

 


En el caso de Sevilla si las ventas son superiores a 850 me muestre el valor verde e inferior rojo Cádiz superior 3500 verde, inferior rojo Málaga superior 2600 verde, inferior rojo
Jaén superior a 2000 verde, inferior rojo

Me podéis orientar cómo podría generar este formato condicional?
Gracias

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JUAN_1969 , If your month is on a column in the original data then unpivot

 

Then create a measure like

 

Assume sales is a measure

 

Switch( True(),
Max(Table[PROVINCE]) = "Seville" && [SALES] > 850 , "Green",
Max(Table[PROVINCE]) = "Cádiz" && [SALES] > 3500 , "Green",
Max(Table[PROVINCE]) = "MÁLAGA" && [SALES] > 2600 , "Green",
Max(Table[PROVINCE]) = "Jaén" && [SALES] > 2000 , "Green",
"Red"
)

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@JUAN_1969 , If your month is on a column in the original data then unpivot

 

Then create a measure like

 

Assume sales is a measure

 

Switch( True(),
Max(Table[PROVINCE]) = "Seville" && [SALES] > 850 , "Green",
Max(Table[PROVINCE]) = "Cádiz" && [SALES] > 3500 , "Green",
Max(Table[PROVINCE]) = "MÁLAGA" && [SALES] > 2600 , "Green",
Max(Table[PROVINCE]) = "Jaén" && [SALES] > 2000 , "Green",
"Red"
)

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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