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
Anonymous
Not applicable

Las expresiones que producen el tipo de datos de variante no se pueden utilizar para definir columnas calculadas

Querida comunidad,

Tengo la siguiente fórmula que está devolviendo el error anterior - por favor, ¿puede ayudarme?

Estoy tratando de lograr una columna que define el estado de un hito basado en fechas. Ya he creado fórmulas anteriores que no funcionaban, pero no recibí este error. Y no estoy mezclando los valores de número y texto, así que no puedo entender por qué no funciona. ¿Puedes ayudarme, por favor?

Básicamente quiero definir el estado del hito de respuesta, en función de las fechas (fecha de respuesta y fecha de destino). Sin embargo y debido a que tengo múltiples condiciones me resultó más fácil utilizar la función de interruptor:

Estado de la respuesta ?

SWITCH(TRUE(),

'tabla principal'[Fecha de respuesta]< 'tabla principal'[Response_Target_Date], "Succeeded",

'tabla principal'[Fecha de respuesta]> 'tabla principal'[Response_Target_Date], AND(OR(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]<TODAY()),"No conforme"),

AND(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]>TODAY()),"Response not sent",

"NA")

¡Gracias!

6 REPLIES 6
az38
Community Champion
Community Champion

@catharin_barrel hola

el problema está en algún lugar de esta parte

'main table'[Response Date]> 'main table'[Response_Target_Date], AND(OR(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]<TODAY()),"Noncompliant"),

AND(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]>TODAY()),"Response not sent",

Yo no era capaz de entender la lógica, pero puedo suponer que usted tiene un incorrecto primero Y

Tratar

Response Status =

SWITCH(TRUE(),
'main table'[Response Date] < 'main table'[Response_Target_Date], "Succeeded",
'main table'[Response Date] > 'main table'[Response_Target_Date] && 
  (OR(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date] < TODAY()), "Noncompliant",
AND(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date] > TODAY()), "Response not sent",
"NA")


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hola

Gracias por su respuesta rápida. La fórmula no está dando ningún error ahora.

Sin embargo, tengo un problema con el estado. Como puede ver en la respuesta a amitchandak. Tal vez tú también puedas ayudar.

Estoy atascado y no puedo moverme más lejos con esto.

¡Gracias!

amitchandak
Super User
Super User

@catharin_barrel , Probar como

Response Status =

SWITCH(TRUE(),
'main table'[Response Date]< 'main table'[Response_Target_Date], "Succeeded",
AND('main table'[Response Date]> 'main table'[Response_Target_Date], OR(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]<TODAY())),"Noncompliant",
AND(ISBLANK('main table'[Response Date]),'main table'[Response_Target_Date]>TODAY()),"Response not sent",
"NA")
Anonymous
Not applicable

Hola

Hola, @catharin_barrel

¿Es este su resultado esperado?

19.png

Pruebe la columna calculada como se indica a continuación:

Response Status = 
IF (
    ISBLANK ( 'main table'[Response_Target_Date] ),
    "N/A",
    IF (
        ISBLANK ( 'main table'[Response Date] )
            && 'main table'[Response_Target_Date] > TODAY (),
        "Response not send",
        IF (
            'main table'[Response Date] <> BLANK ()
                && 'main table'[Response Date] <= TODAY ()
                && 'main table'[Response Date] < 'main table'[Response_Target_Date],
            "Succeeded",
            "Noncompliant"
        )
    )
)

pbix adjunto

Saludos
Equipo de soporte de la comunidad _ Eason
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Anonymous
Not applicable

Hola @v-easonf-msft Gracias por su respuesta. Eso es exactamente lo que necesito. Acabo de replicar su fórmula en mi pbix y... está trabajando! ¡No sabes lo feliz que estoy ahora! ¡Muchas gracias por tu ayuda!

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.