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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors