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
Syndicate_Admin
Administrator
Administrator

Coincidencia entre varias filas y columnas

Soy nuevo en Power Bi y estoy tratando de crear una fórmula que devuelva un número de equipo si:

Antje_0-1647281354795.png

- un número de equipo en la columna Equipo aparece más de una vez Y
- al menos una línea de los números de equipo coincidentes en la columna Ubicación tiene "Sala de exposición" o "Capacitación" Y
- al menos una línea de los números de equipo coincidentes en la columna Fecha de Invoice tiene una fecha Y
- al menos una línea de los números de equipo coincidentes en la columna Tipo de pedido tiene la palabra clave "Venta"



1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hay @Antje ,

Cree una columna personalizada con el siguiente código y úsela como filtro en su objeto visual:

Column =
VAR _count =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
        )
    )
VAR _location =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Location] IN { "Showroom", "Location" }
        )
    )
VAR _invoice_Date =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Invoice date] <> BLANK ()
        )
    )
VAR _ordertype =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Order type] IN { "Sale" }
        )
    )
RETURN
    IF (
        _count >= 2
            && _location >= 1
            && _invoice_Date >= 1
            && _ordertype >= 1,
        1,
        0
    )

Samarth_18_0-1647287206199.png

salida:-

Samarth_18_1-1647287255127.png

Gracias

Samarth

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

¡Muchas gracias, Samarth! Esto funcionó perfectamente.

Syndicate_Admin
Administrator
Administrator

Hay @Antje ,

Cree una columna personalizada con el siguiente código y úsela como filtro en su objeto visual:

Column =
VAR _count =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
        )
    )
VAR _location =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Location] IN { "Showroom", "Location" }
        )
    )
VAR _invoice_Date =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Invoice date] <> BLANK ()
        )
    )
VAR _ordertype =
    COUNTROWS (
        FILTER (
            'Table (5)',
            'Table (5)'[Eqipment] = EARLIER ( 'Table (5)'[Eqipment] )
                && 'Table (5)'[Order type] IN { "Sale" }
        )
    )
RETURN
    IF (
        _count >= 2
            && _location >= 1
            && _invoice_Date >= 1
            && _ordertype >= 1,
        1,
        0
    )

Samarth_18_0-1647287206199.png

salida:-

Samarth_18_1-1647287255127.png

Gracias

Samarth

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.