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
JonSwed
Advocate II
Advocate II

Colorea diferentes países en función de los criterios

Hola magos powerbi,

Estoy usando la visualización del mapa, funciona bastante bien. Estoy importando datos de Google Analytics y mostrando sesiones por país en el mapa. Hasta ahora, bien.

Lo que también me gustaría hacer es colorear países basados en si tienen un cierto valor en mi conjunto de datos. En este caso serían tres valores diferentes, 'activo', 'en curso' y 'nada planeado' o similar. Estos estarían representados en el mapa con tres colores diferentes.

¿Me gustaría saber si puedo hacer esto? Gracias de antemano.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@JonSwed - Sí, debería poder poner eso en la Leyenda si es una columna. Si se trata de una medida, utilice el truco de tabla desconectada - En general, para utilizar una medida de esa manera, debe utilizar el truco de tabla desconectada como se muestra en este artículo: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@JonSwed , compruebe si este formato condicional está permitido en el mapa. Puede crear una medida de color y utilizar la opción de campo en formato condicional

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))

Color  = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 
,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Greg_Deckler
Super User
Super User

@JonSwed - Sí, debería poder poner eso en la Leyenda si es una columna. Si se trata de una medida, utilice el truco de tabla desconectada - En general, para utilizar una medida de esa manera, debe utilizar el truco de tabla desconectada como se muestra en este artículo: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Gracias por la ayuda chicos. Pude agregar los estados necesarios en una nueva columna (utilicé la función merge para crearla) y luego agregarlos como la leyenda funcionaba como un encanto.

¡Gran!

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.