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
Sriku
Helper IV
Helper IV

Agrupación +/- porcentaje

Hola

Necesito agruparme como R/A/G : Verde á (-/+ <5%), Ámbar + /- >5% y +/- <15%, Rojo -+/- >15%

IF($A2"","""Y(Y($A2>-(-0.05),$A2<-0.05),"Green",IF(AND($A2>-(-0.15),$A2<-0.15),"Amber","Rojo"))

Porcentaje %Trapo
-16.667%Rojo
-2.473%Verde
-4.545%Verde
-12.903%Ámbar
0.000%Verde
0.000%Verde
0.000%Verde
-30.000%Rojo
-50.000%Rojo
0.000%Verde
-50.000%Rojo
0.000%Verde
0.000%Verde
0.000%Verde
0.000%Verde
0.000%Verde
-12.500%Ámbar
0.000%Verde
-0.350%Verde
433.333%Rojo
0.000%Verde
0.000%Verde
56.637%Rojo
100.855%Rojo
100.000%Rojo
-50.000%Rojo
-20.000%Rojo
-41.935%Rojo
387.805%Rojo
-75.699%Rojo
10 REPLIES 10
DataInsights
Super User
Super User

@Sriku, pruebe esta medida:

Measure = 
VAR vPct =
    MAX ( Percentages[Percentage] )
VAR vResult =
    SWITCH (
        TRUE (),
        vPct >= -.05
            && vPct <= .05, "Green",
        vPct >= -.15
            && vPct <= .15, "Amber",
        "Red"
    )
RETURN
    vResult




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Quiero hacerlo en el nivel de consulta De potencia. ¿Puedes ayudarme, por favor, en esto?

if [Percentage] >= -.05 and [Percentage] <= .05 then "Green" else
if [Percentage] >= -.15 and [Percentage] <= .15 then "Amber" else
"Red"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Da correcto para el verde. también existen en blanco. Cómo tratar eso también

if [Percentage] = null then null else
if [Percentage] >= -.05 and [Percentage] <= .05 then "Green" else
if [Percentage] >= -.15 and [Percentage] <= .15 then "Amber" else
"Red"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Incluso después de aplicar esta lógica algunos -5%( Debe ser verde, pero buckted como ámbar y algunos -15 (debe ser ámbar, pero en cubos como rojo). ¿No estás seguro de lo que está pasando? Cdánúmelo, por favor.

¿Podría dar un ejemplo? Entré en una fila con -.05 y vuelve verde. ¿Cuál es el tipo de datos de la columna de porcentaje?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Intenté cambiar el tipo de datos a percetange, número entero, pero para estos no estoy obteniendo los cubos correctos. ¿Necesito cambiar el tipo de datos a otra cosa e intentar:

Porcentaje %Bandera
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
0.05Ámbar
-0.15Rojo
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.15Rojo
-0.15Rojo
-0.15Rojo
-0.15Rojo
-0.15Rojo
-0.15Rojo
-0.05Ámbar
-0.15Rojo
-0.05Ámbar
-0.15Rojo
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
0.05Ámbar
-0.15Rojo
-0.05Ámbar
-0.15Rojo
-0.15Rojo
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar
-0.05Ámbar

Recomiendo el tipo de datos "Número decimal". Eso es lo que estoy usando y funciona correctamente.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




¿Debo considerar "número decimal" o "decimal fijo" para agrupar

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.