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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
newbiepbix
Microsoft Employee
Microsoft Employee

Agrupar filas en función de las condiciones

Hola a todos,

Soy nuevo en PBI y necesité ayuda. Tengo un escenario donde necesito que las filas se fusionen / agrupan:

La siguiente tabla es lo que tengo en mis datos:

TítuloTipo

A

Ambos
ASólo Parte1
ASólo Parte2
AEn
BSólo Parte1
BSólo Parte2
BEn
CSólo Parte1
CEn
DSólo Parte2
DEn
EEn

y la siguiente tabla es lo que estoy buscando para obtener :

TítuloTipo
AAmbos
BAmbos
CSólo Parte1
DSólo Parte2
EEn

Explicación : Ambos > Parte1 Y Parte2 > Parte1 > Parte 2 > NA.

(En el caso del Título B viene como Ambos porque tiene dos partes separadas1 y Parte2)

Si alguien pudiera por favor ayudarme sería de gran ayuda.

¡Gracias!

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hola @newbiepbix

Sólo tiene que utilizar esta lógica para crear una nueva tabla

New Table = 
    SUMMARIZE (
        'Table',
        'Table'[Title],
        "Type", IF (
            "Both" IN VALUES ( 'Table'[Type] ),
            "Both",
            IF (
                "Part1 only" IN VALUES ( 'Table'[Type] )
                    && "Part2 only" IN VALUES ( 'Table'[Type] ),
                "Both",
                IF (
                    "Part1 only" IN VALUES ( 'Table'[Type] ),
                    "Part1 only",
                    IF ( "Part2 only" IN VALUES ( 'Table'[Type] ), "Part2 only", "NA" )
                )
            )
        )
    )

Resultado:

1.JPG

y aquí está el archivo pbix de muestra, por favor pruébelo.

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

¡¡¡¡Muchas gracias!!!! Esto funcionó como un encanto.

amitchandak
Super User
Super User

@newbiepbix, cree una nueva medida como esta e intente

nueva medida :Switch(
countx(filter(table,table[Type]-"Both"),table[Title])>-1,"Both",
countx(filter(table,table[Type]-"Part1 AND Part2"),table[Title])>-1,"Part1 AND Part2",
countx(filter(table,table[Type]-"Part1"),table[Title])>-1,"Part1",
countx(filter(table,table[Type]"Part 2"),table[Title])>-1,"Part 2",
"NA"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.