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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Clasificar los artículos basados en el cliente comprados

Me gustaría poder clasificar y luego filtrar a los clientes en un informe en función de lo que compraron. Mis criterios de cliente son:
1. si un cliente solo ha comprado productos estándar, entonces son un cliente "estándar"

2. si un cliente solo ha comprado productos Classic, entonces son un cliente "clásico"

3. si compraron productos clásicos y estándar, entonces son un cliente "ambos"

4. si compraron un producto Premium, entonces son un cliente "Premium"

En este caso, el cliente A - Estándar, el cliente B - ambos, el cliente C - Clásico, el cliente D - Premium. Quiero crear una columna calculada que indique el tipo de cliente que son (Estándar, Clásico, Ambos o Premium)

¿Alguna sugerencia sobre cómo lograr esto? ¡Gracias!

ClienteProducto compradoTipo de cliente (columna deseada)
AEstándarEstándar
AEstándarEstándar
AEstándarEstándar
BClásicoAmbos
BEstándarAmbos
BClásicoAmbos
CClásicoClásico
C ClásicoClásico
DPremiumPremium

1 ACCEPTED SOLUTION

@jack421 ,

En tal caso mejor para que sea como la columna, busque el archivo adjunto.

Aprecia tus Felicitaciones.

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

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@jack421 , Por favor, encuentre la solución adjunta utilizando medidas

Screenshot 2020-03-15 11.01.37.png

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
Anonymous
Not applicable

Gracias @amitchandak! Una última cosa: ¿cómo crearía un filtro con la medida de calcomanía de tipo de cliente? Quiero saber cuántos clientes hay y el desglose por tipo de cliente.

@jack421 ,

En tal caso mejor para que sea como la columna, busque el archivo adjunto.

Aprecia tus Felicitaciones.

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
Ashish_Mathur
Super User
Super User

Hola

Escriba esta fórmula de columna calculada

Category = if(CALCULATE(DISTINCTCOUNT(Data[Product Bought]),FILTER(Data,Data[Customer]=EARLIER(Data[Customer])))=1,Data[Product Bought],"Both")

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hola @Ashish_Mathur, gracias por la respuesta. Con la solución no pude escribir una columna de tabla después de la función Anterior por alguna razón. ¿Podrías también echar un vistazo a mi publicación editada y ver si tu posible solución podría ser diferente de tu publicación original?

Hola

Como pueden ver, mi fórmula funciona muy bien. La mía es una fórmula de columna calculada.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@jack421 ,

probar los 4 como medidas

all= calculate(distinctCOUNT(table[Product Bought]))
Standard =calculate(distinctCOUNT(table[Product Bought]), Product Bought="Standard")
Classic =calculate(distinctCOUNT(table[Product Bought]), Product Bought="Classic")

flag =
Switch(true(),
[all]=[Standard],"Standard",
[all]=[Classic],"Classic",
"Both"
)


Aprecia tus Felicitaciones.

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
Greg_Deckler
Community Champion
Community Champion

Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hola @Greg_Deckler , gracias por su respuesta! ¿Podrías echar un vistazo a mi publicación modificada? En realidad me di cuenta de que quiero crear una columna calculada llamada Tipo de cliente (estándar, clásico, ambos o premium). Por favor, hágamelo saber si sabe de una manera de hacerlo en Power BI.

@jack421 Puede crear una columna como esta:

Customer Type = 
    VAR __Table = 
        SUMMARIZE(
            FILTER(
                'Table',
                [Customer] = EARLIER([Customer])
            ),
            [Product Bought]
        )
RETURN
    SWITCH(TRUE(),
        "Premium" IN __Table,"Premium",
        "Standard" IN __Table && "Classic" IN __Table,"Both",
        "Classic" IN __Table,"Classic",
        "Standard" IN __Table,"Standard"
    )



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 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.

Top Kudoed Authors