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

Lógica de clasificación de clientes

Hola a todos, estoy tratando de crear lógica para una nueva columna Tipo de cliente:

Clasificación de tipo de cliente -> Interior, Exterior, Ambos

  1. si todas las instancias reales de un cliente son Interiores --> el tipo de cliente es Interior
  2. si todas las instancias reales son Exterior --> el tipo de cliente es Exterior
  3. si algunas instancias reales son interiores y algunas son al aire libre o nulas -->

Tenga en cuenta que quiero ignorar a todos los clientes con Estado que contiene el texto "Actual"

ClienteEstadoTipo de productoTipo de cliente (columna deseada)
APruebaInteriorAl aire libre
AActual1Al aire libreAl aire libre
AActual2Al aire libreAl aire libre
BActual1InteriorInterior
BPruebaInteriorInterior
BActual2InteriorInterior
CActual1Al aire libreAmbos
CActual2 Ambos
CActual 3InteriorAmbos

¿Podría alguien ayudarme a averiguar cómo implementar esta lógica en una nueva columna? ¡Gracias!

4 REPLIES 4
parry2k
Super User
Super User

@jack421 probar algo como esto, agregue esto como una columna

Pregunte cualquier cosa Power BI. Reserva una cita para una consulta gratuita en https://www.perytus.com

Customer Type = 
VAR __indoor = 
COUNTROWS( 
    CALCULATETABLE( 
        VALUES ( Customer[Product type] ), 
        ALLEXCEPT ( Customer, Customer[Customer] ), 
        Customer[Product type] = "Indoor" , 
        CONTAINSSTRING( Customer[Status] , "Actual" )
    ) 
)
VAR __outdoor =COUNTROWS( 
    CALCULATETABLE( 
        VALUES ( Customer[Product type] ), 
        ALLEXCEPT ( Customer, Customer[Customer] ), 
        Customer[Product type] = "Outdoor" , 
        CONTAINSSTRING( Customer[Status] , "Actual" )
    ) 
)
RETURN
SWITCH ( TRUE(),
    __indoor = 1 && __outdoor = 1, "Both",
    __indoor = 1, "Indoor",
    __outdoor = 1, "Outdoor"
)

Apreciaría Kudos 🙂 si mi solución me ayudara.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@jack421 cliente A supone ser Ambos, ¿no?

Pregunte cualquier cosa Power BI. Reserva una cita para una consulta gratuita en https://www.perytus.com



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k no, quiero ignorar dónde estado - Prueba, sólo quiero ver donde Estado contiene el texto "Real"

Hola @jack421 ,

Pruebe este código:

Columna ?
VAR _result - CALCULATE(DISTINCTCOUNT('Table'[Product type]); FILTRO(ALLEXCEPT('Tabla';' Tabla'[Cliente]); SEARCH("Actual"; 'Tabla'[Estado]; 1;0) > 0))
DEVOLUCION IF(_result 1; CALCULATE(DISTINCT('Table'[Tipo de producto]); FILTRO(ALLEXCEPT('Tabla';' Tabla'[Cliente]); SEARCH("Actual"; 'Tabla'[Estado]; 1;0) > 0)); "Ambos")
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



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.

Top Kudoed Authors