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

Mostrar los datos más recientes en función de otros campos

Hola a todos

A continuación se muestra un conjunto de datos de ejemplo:

Después #Factura #FechaCantidad
123q12301-02-202020
456q45602-02-202030
789q78903-04-20202
789a78905-04-20203
789z78906-04-20205

Quiero mostrar los últimos datos para cada PO, por lo tanto, el resultado debe ser:

Después #Factura #FechaCantidad
123q12301-02-202020
456q45602-02-202030
789z78906-04-20205

¿Alguna sugerencia sobre cómo puedo lograr esto a través de DAX?

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hola @Vysakh

Puede crear una medida como a continuación

Measure = 
VAR __maxDate = 
    CALCULATE(
        MAX( 'Table'[Date] ),
        ALL( 'Table' ),
        VALUES( 'Table'[PO#] )
    )
RETURN 
CALCULATE(
    INT( NOT ISEMPTY( 'Table' ) ),
    'Table'[Date] = __maxDate 
)

Y úsalo como filtro visual como a continuación

image.png

Saludos
Mariusz

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

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Medida ?
VAR __id - MAX ( 'Tabla'[PO ] )
VAR __date - CALCULATE ( MAX( 'Table'[Date] ), ALLSELECTED ( 'Table' ), 'Table'[PO ? ? __id )
RETURN CALCULATE ( sum ( 'Table'[Quantity] ), VALUES ( 'Table'[PO '), 'Table'[PO' - __id, 'Table'[Date] - __date )

Mariusz
Community Champion
Community Champion

Hola @Vysakh

Puede crear una medida como a continuación

Measure = 
VAR __maxDate = 
    CALCULATE(
        MAX( 'Table'[Date] ),
        ALL( 'Table' ),
        VALUES( 'Table'[PO#] )
    )
RETURN 
CALCULATE(
    INT( NOT ISEMPTY( 'Table' ) ),
    'Table'[Date] = __maxDate 
)

Y úsalo como filtro visual como a continuación

image.png

Saludos
Mariusz

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

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

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.