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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

omitir una fila y reescribir los mismos valores de la 2ª fila

Hola, tengo una pequeña pregunta. Tengo una columna X con 1 2 3 4 5 6 como números y quiero que se agregue una columna con Y como igual que X, pero la 1ª fila debe omitirse en Y cuando se compara con X. Como el siguiente.

X Y

1

2 1

3 2

4 3

5 4

6 5

6

c

¿Alguien puede sugerirme la solución con un código DAX o cualquier otra cosa?

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@ParsiNitin ,

Pruebe lo siguiente:

Table2 = DISTINCT(UNION( SELECTCOLUMNS('Table',"X",'Table'[X]),SELECTCOLUMNS('Table',"X",0)))
Y = IF (
        Table2[X]=0,
       CALCULATE(MAX(Table2[X]),ALL(Table2)),
IF (
    CALCULATE (
        MAX ( 'Table2'[x] ),
        FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) )
    ) = 0,
    BLANK (),
   
        CALCULATE (
            MAX ( 'Table2'[x] ),
            FILTER ( ALL ( Table2 ), Table2[x] < EARLIER ( Table2[X] ) )
        )
    )
)

vluwangmsft_0-1654845938415.png

¿Respondí a su pregunta? ¡Marca mi post como solución!


Saludos

Lucien

Syndicate_Admin
Administrator
Administrator

Cargue transformar datos (Power Query), agregue una columna de índice. (Llamaremos a este índice, por ejemplo)
A continuación, salga de Power Query,
Agregue el código siguiente como una columna calculada.
Y =
VALOR DE BÚSQUEDA («Tabla»[X],«Tabla»[Índice],«Tabla»[Índice]-1)
Desactive el resumen para X e Y, luego agregue a una tabla y listo!

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors