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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
HenryJS
Post Prodigy
Post Prodigy

Matriz: IF Columna y Colores de Estado

Hola a todos

Me gustaría crear dos columnas de cálculo que se muestran a continuación:

  • 'Estado del vehículo' - SI MOT o Servicio - Fin de semana ENTONCES MOT o Fecha de Servicio ELSE "En Uso"
  • 'Obras' - SI MOT o Servicio - Fin de semana Entonces "MOT" o "Servicio

Entonces quiero crear una medida que dicte los colores de MOT o Service in Works en una matriz

Número de registro del vehículoFin de semana - TextoServicio ContraEstado del vehículoObras
CXZ 800214/02/2021 14/02/202114/02/2021Contra
GXZ 291827/09/202001/09/202027/09/202027/09/2020Servicio
GXZ309201/03/2020 En uso
NV19 YJA01/03/2020 En uso

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hola @HenryJS ,

Un poco confuso, ¿por qué el valor de la columna Works para la segunda fila es "service"?

¿Y cómo es tu martix?

Aquí está mi fórmula para tu referencia.

Vehicle Status = IF('Table'[Week Ending - Text]='Table'[Service ],'Table'[Service ],IF('Table'[Week Ending - Text]='Table'[MOT],'Table'[MOT]))

Works = IF('Table'[Week Ending - Text]='Table'[Service ],"service",IF('Table'[Week Ending - Text]='Table'[MOT],"mot"))

4.PNG

Y podrías crear una medida como

measure = IF(selectedvalue('table'[works])="mot",1,0)

A continuación, utilice el formato condicional:

Cuando la medida 1 entonces "rojo", cuando meausre 2 entonces "verde".

Saludos

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hola @HenryJS ,

Un poco confuso, ¿por qué el valor de la columna Works para la segunda fila es "service"?

¿Y cómo es tu martix?

Aquí está mi fórmula para tu referencia.

Vehicle Status = IF('Table'[Week Ending - Text]='Table'[Service ],'Table'[Service ],IF('Table'[Week Ending - Text]='Table'[MOT],'Table'[MOT]))

Works = IF('Table'[Week Ending - Text]='Table'[Service ],"service",IF('Table'[Week Ending - Text]='Table'[MOT],"mot"))

4.PNG

Y podrías crear una medida como

measure = IF(selectedvalue('table'[works])="mot",1,0)

A continuación, utilice el formato condicional:

Cuando la medida 1 entonces "rojo", cuando meausre 2 entonces "verde".

Saludos

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
lkalawski
Memorable Member
Memorable Member

Hola @HenryJS

Debe crear una medida:

Measure = 
SWITCH([Works M],
"MOT", "#FF0",
"Service", "#F0F"
)

Y utilícelo en la sección de formato condicional de la columna Works:

lkalawski_0-1599646654483.png

El resultado:

lkalawski_1-1599646675520.png



_______________
Si ayudé, por favor acepte la solución y dar felicitaciones! 😀

amitchandak
Super User
Super User

@HenryJS , Pruebe nuevas columnas como

Estado del vehículo - IF( [MOT] á[Fin de semana] [Servicio] - [Fin de semana] , if([MOT] á[Fin de semana] , [MOT] , [Servicio]) , [Fin de semana] y "" , "En uso")
Obras de trabajo: IF( [MOT] á[Fin de semana] [Servicio] - [Fin de semana] , if([MOT] á [Fin de semana] , "MOT" , "Servicio"),blank())

@amitchandak esto no funcionó, ¿hay una forma más sencilla de reestructurar los datos que me permita traer más columnas en una fecha posterior?

Capture.PNG

@HenryJS ,

Tratar

Estado del vehículo - IF( [MOT] á[Fin de semana] [Servicio] - [Fin de semana] , if([MOT] á [Fin de semana] , [MOT] , [Servicio]) & "" , "En uso")
Obras de trabajo: IF( [MOT] á[Fin de semana] [Servicio] - [Fin de semana] , if([MOT] á [Fin de semana] , "MOT" , "Servicio"),blank())

Para el formato condicional, cree una medida y use esa opción "Valor de campo"

@amitchandak Cómo puedo agregar otra columna? por ejemplo, si quería añadir otro campo de fecha para 'Last Service'

gracias por su ayuda

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors