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.
Hola
Tengo la siguiente declaración if
Missed Deadlines =
if('Maintenance Ticket System'[Status] = "Critical" & 'Maintenance Ticket System'[JobStarted]>1,"Missed",
if('Maintenance Ticket System'[Status] = "High" & 'Maintenance Ticket System'[JobStarted]>2,"Missed",
if('Maintenance Ticket System'[Status] = "Medium" & 'Maintenance Ticket System'[JobStarted]>3,"Missed",
if('Maintenance Ticket System'[Status] = "Low" & 'Maintenance Ticket System'[JobStarted]>5,"Missed",""))))
Sin embargo, recibo el error
Las operaciones de comparación de DAX no admiten la comparación de valores de tipo True/False con valores de tipo Integer. Considere la posibilidad de utilizar la función VALUE o FORMAT para convertir uno de los valores.
¿Alguna ayuda?
Necesitas usar doble ampersand '&&' entre tus argumentos lógicos. Un solo ampersand simplemente intenta concatenar texto.
También recomendaría usar la función SWITCH en lugar de sus instrucciones IF anidadas, ya que hace que el código sea más fácil de leer.
Weekly Service Charge = SWITCH ( TRUE (), UnitCharge[ChargeFrequencyRef] = "M" && DATESBETWEEN ( UnitCharge[StartDate], 01 / 04 / 2018, 01 / 04 / 2019 ) && UnitCharge[ChargeTypeId] = 2, UnitCharge[ChargeAmount] * 12 / 52, UnitCharge[ChargeFrequencyRef] = "Q" && DATESBETWEEN ( UnitCharge[StartDate], 01 / 04 / 2018, 01 / 04 / 2019 ) && UnitCharge[ChargeTypeId] = 2, UnitCharge[ChargeAmount] * 4 / 52, UnitCharge[ChargeFrequencyRef] = "Y" && DATESBETWEEN ( UnitCharge[StartDate], 01 / 04 / 2018, 01 / 04 / 2019 ) && UnitCharge[ChargeTypeId] = 2, UnitCharge[ChargeAmount] / 52, UnitCharge[ChargeFrequencyRef] = "W" && DATESBETWEEN ( UnitCharge[StartDate], 01 / 04 / 2018, 01 / 04 / 2019 ) && UnitCharge[ChargeTypeId] = 2, UnitCharge[ChargeAmount] )
Regards,
Ritesh
¿Cuál es el nuevo error?
Igual que el anterior: parece que no le gusta que la comparación tenga texto e entero.
Incluso lo intenté
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |