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

¿Se puede _var medir con texto en visualizaciones?

Tengo una medida que utiliza múltiples funciones _var que ultimatley dan como resultado una "palabra" o "frase de texto" específica. En otras palabras, después de escribir Result, lo sigo con IF( _var-1, "Error" , "Sin error"). Al arrastrar la medida a mi tabla, puedo ver los errores y sin errores en miles de filas. Simplemente quiero contar el número de veces que aparece "Error" y mostrarlo en un gráfico de barras para que pueda mostrar mejoras con el tiempo. ¿Es posible?

5 REPLIES 5
az38
Community Champion
Community Champion

Hola @Jacob111

probar esto

Count Error Measure = CALCULATE(COUNTROWS(Table), FILTER(ALL(Table), [YourMeasure] = "Error"))


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

@amitchandak A continuación se muestran algunos datos de ejemplo. Error de unidad de precios es la medida y se puede ver encima de la tabla. Si puedes agilizar esta fórmula para que sea menos pesada de CPU, ¡sería fantástico!

@az38 La solución puede funcionar, sin embargo, la función count se está ejecutando fuera de la fórmula siguiente y ocupa demasiada CPU para calcular.

0 Pricing Unit Error = 
var _ID = SELECTEDVALUE('Table'[Unique (Contract, Material, Item)])
var _Ifhaserror = 
CALCULATE(
    DISTINCTCOUNT('Table'[Pricing Unit]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Unique (Contract, Material, Item)] = _ID
    )
)

var _start = 
CALCULATE(
    SUM('Table'[Pricing Unit]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Unique (Contract, Material, Item)]=_ID&&
        'Table'[Contract End]  = 
        CALCULATE(
            MIN('Table'[Contract End]),
            FILTER(
                ALL('Table'),
                'Table'[Unique (Contract, Material, Item)] = _ID
            )
        )
    )
)

var _end = 
CALCULATE(
    SUM('Table'[Pricing Unit]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Unique (Contract, Material, Item)]=_ID&&
        'Table'[Contract End] = 
        CALCULATE(
            MAX('Table'[Contract End]),
            FILTER(
                ALL('Table'),
                'Table'[Unique (Contract, Material, Item)] = _ID
            )
        )
    )
)

return
IF(
    _Ifhaserror=1,
    "No Error",
    IF(
        _Ifhaserror>1&&_start=_end,
        "This Error has been Corrected",
        IF(
            _Ifhaserror>1&&_start<>_end,
            "Error"
        )
    )
)

Exclusivo (Contrato, Material, Artículo)Contrato #MaterialArtículoUnidad de preciosInicio del contratoFin del contratoError de la unidad de precios
45643 5 1045643510100011/2/20182/3/2019Sin error
45643 5 104564351010002/4/201912/31/2999Sin error
54353 4 1054353410100010/10/20191/5/2020Sin error
54353 4 105435341010001/6/202012/31/2999Sin error
54353 7 2054353720100010/10/20191/5/2020Sin error
54353 7 205435372010001/6/202012/31/2999Sin error
23455 5 1023455510110/18/201912/31/2999Sin error
23455 2 2023455220110/18/201912/31/2999Sin error
43543 7 1043543710100010/18/20193/5/2020Sin error
43543 7 104354371010003/6/20203/31/2020Sin error
43543 7 104354371010004/1/202012/31/2999Sin error
2435 5 102435510111/1/20191/6/2020Error
2435 5 10243551010001/7/202012/31/2999Error
4564 8 104564810111/1/20191/29/2020Error
4564 8 10456481011/30/20203/22/2020Error
4564 8 10456481010003/23/202012/31/2999Error
4564 1 204564120111/1/20191/29/2020Error
4564 1 20456412011/30/20203/9/2020Error
4564 1 20456412013/10/20203/22/2020Error
4564 1 20456412010003/23/202012/31/2999Error
765456 9 2076545692011/1/20201/9/2020Este error se ha corregido
765456 9 20765456920100011/4/201912/31/2019Este error se ha corregido
765456 9 2076545692010001/10/20203/4/2020Este error se ha corregido
765456 9 2076545692010003/5/20203/5/2020Este error se ha corregido
765456 9 2076545692010003/6/202012/31/2999

Este error se ha corregido

Hola @Jacob111 ,

¿Está resuelto su problema?

Saludos
Kelly
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!

Hola @Jacob111 ,

Esto parece un problema de totales de medida. Muy común. A continuación se muestra un hilo similar al respecto:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Además, esta medida rápida, medida totales, la palabra final debe obtener lo que necesita:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Saludos
Kelly
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
amitchandak
Super User
Super User

@Jacob111 , ¿Puede compartir datos de ejemplo y salida de muestra.

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.