Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors