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
polanddm
Regular Visitor

Crear rango de filtrado de medida según el valor de columna en una tabla diferente

Tengo un modelo de datos con dos tablas.
La tabla EST tiene un valor estimado para X por fecha
La Tabla ACT tiene valores reales para X por fecha

Me gustaría crear una nueva medida (NewerX) que filtre los valores de ACT en función de la fecha más reciente (o máxima) en EST, pero conserve la fecha de los valores de ACT.

Intenté esto:

NewerX - CALCULATE(SUM(ACT[X]), filter(ACT,ACT[Date] > MAX(EST[Date])))

Sin embargo, cuando veo ACT[Date] & NewerX en un objeto Visual de tabla, la fecha parece ser la *primera* fechas en ACT en lugar de las fechas que son > MAX(EST[Date])

¿Alguna idea de cómo obtener los resultados deseados?

Gracias

Doug

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hola @polanddm ,

¿Cuál es la relación entre dos tablas? hacemos una muestra y obtenemos el resultado esperado:

2.jpg

Por favor, trate de establecer el ACT[Fecha] como no resumir, si no funciona, intente utilizar la siguiente medida:

Measure = if(min(ACT[Date]) > Max(EST[Date]), SUM(ACT[X]), BLANK())


Por cierto, pbIX archivo como adjunto.


Saludos

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

Gracias por la ayuda.

Todavía no estoy recibiendo los valores esperados.

Aquí está la captura de pantalla

Capture.PNG

NewerACWP - if ('Jamis'[APEndDate]), sum ('Jamis'[BurdenedCost]), BLANK)


El objeto visual izquierdo es Jamis (ACT), el visual medio es CobraSummary (EST) y el visual derecho se mide.

ACT (Jamis) y EST (CobraSummary) se relacionan a través del campo llamado "TO" (en segmentación desplegable).

¿Ayuda esto a discernir lo que estoy haciendo mal?

¡Gracias!

Hola @polanddm ,

¿Qué tal el resultado después de seguir las sugerencias mencionadas en mi publicación original? ¿Podría proporcionar más detalles al respecto si no cumple con su requisito?


Saludos

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

Hola @polanddm ,

Parece porque la tabla 'Jamis' no puede filtrar la tabla 'CobraSummary' correctamente, si tiene una tabla intermedia como la siguiente:

'Jamis'[TO] M<--1 'TOTable'[TO] 1 -->M 'CobraSummary'[TO]

Por favor, intente utilizar el siguiente código:

NewerACWP =
IF (
    MIN ( 'Jamis'[APEndDate] )
        > CALCULATE (
            MAX ( 'CobraSummary'[Date] ),
            FILTER (
                ALLSELECTED ( 'CobraSummary' ),
                'CobraSummary'[TO] IN DISTINCT ( 'TOTable'[TO] )
            )
        ),
    SUM ( 'Jamis'[BurdenedCost] ),
    BLANK ()
)

Si tiene una relación como la siguiente

'Jamis'[TO] M<---->M 'CobraSummary'[TO]

Por favor, intente utilizar la siguiente fórmula:

NewerACWP =
IF (
    MIN ( 'Jamis'[APEndDate] )
        > CALCULATE (
            MAX ( 'CobraSummary'[Date] ),
            FILTER (
                ALLSELECTED ( 'CobraSummary' ),
                'CobraSummary'[TO] IN DISTINCT ( 'Jamis'[TO] )
            )
        ),
    SUM ( 'Jamis'[BurdenedCost] ),
    BLANK ()
)

O puede utilizar lo siguiente:

NewerACWP =
IF (
    MIN ( 'Jamis'[APEndDate] )
        > CALCULATE ( MAX ( 'CobraSummary'[Date] ), ALLSELECTED () ),
    SUM ( 'Jamis'[BurdenedCost] ),
    BLANK ()
)


Saludos

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

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.