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
RichardJ
Responsive Resident
Responsive Resident

Sintaxis para la medida de recuento acumulativo con múltiples criterios

Hola

Tengo esta medida acumulativa que funciona bien:

Cumulative Change Notes =
CALCULATE (
    COUNTA ( Company_Documents[ID] ),
    FILTER (
        ALLSELECTED ( Company_Documents ),
        Company_Documents[DOC_CREATION_DATE]
            <= MAX ( Company_Documents[DOC_CREATION_DATE] )
    )
)

Sin embargo, me gustaría limitar el resultado agregando un criterio adicional al filtro (comienza &&)

Cumulative Change Notes =
CALCULATE (
    COUNTA ( Company_Documents[ID] ),
    FILTER (
        ALLSELECTED ( Company_Documents ),
        Company_Documents[DOC_CREATION_DATE]
            <= MAX ( Company_Documents[DOC_CREATION_DATE] )
            && Company_Documents[Document Class] = "Change Note"
    )
)

Debo tener la sintaxis incorrecta, ya que hay registros disponibles que coinciden con los criterios.

¿Puede alguien darme un puntero sobre dónde me he equivocado al agregar los criterios de filtro adicionales?

Gracias
Richard

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hola @RichardJ

Prueba esto.

Cumulative Change Notes =
VAR __maxCreationDate = MAX ( Company_Documents[DOC_CREATION_DATE] )
RETURN 
CALCULATE (
    COUNTA ( Company_Documents[ID] ),
    ALLSELECTED ( Company_Documents ),
    Company_Documents[DOC_CREATION_DATE] <= __maxCreationDate,
    Company_Documents[Document Class] = "Change Note"
)
Saludos
Mariusz

Si este post ayuda, entonces considere aceptarlo como la solución.

Por favor, siéntase libre de conectarse conmigo.
Linkedin

RichardJ
Responsive Resident
Responsive Resident

@Mariusz Muchas gracias por la idea y la respuesta rápida.

Esto funciona perfectamente.

Inicialmente no pensé que hubiera funcionado ya que no le estaba dando suficiente tiempo para calcular (circa 5 segundos) la respuesta.


Gracias de nuevo,

Richard

Mariusz
Community Champion
Community Champion

Hola @RichardJ

Pruebe esto en su lugar, si no funciona considere la posibilidad de crear una muestra de datos para que podamos probar y aplicar fórmulas.


Saludos
Mariusz

Si este post ayuda, entonces considere aceptarlo como la solución.

Por favor, siéntase libre de conectarse conmigo.
Linkedin
RichardJ
Responsive Resident
Responsive Resident

@Mariusz: el archivo vinculado muestra las fórmulas que proporcionó trabajando. Perfectamente.

Tuve que revertir mi archivo real (no este extracto) para que funcionara correctamente, ya que se había corrompido de alguna manera.

Esperemos que el ejemplo de trabajo adjunto ayude a alguien en el futuro.

Gracias de nuevo @Mariusz - conseguir una solución para esto hizo mi día.

Salud

Richard

Cumulative Total, then broken down cumulative sub sectionsTotal acumulado y, a continuación, desglosa las subsecciones acumulativas

RichardJ
Responsive Resident
Responsive Resident

@Mariusz Gracias por la respuesta y la buena idea, pero por desgracia no ha funcionado.

He comprobado el valor De tabla[Columna] y "Cambiar nota" y estoy preciso, así que no estoy seguro de qué más probar.

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.