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
Raulx_7
Helper I
Helper I

Ayuda con el filtrado de datos

Hola, he estado tratando de filtrar datos sin éxito. Lo que tengo que hacer es seleccionar los ID que contienen los 3 elementos deseados de una tabla como esta:

IdID de objetoNombre del objetoValor del objeto
11Rojo1
12Negro2
13Amarillo1
14Azul1
21Rojo2
22Negro1
23Amarillo1
24Azul1
25Marrón2
26Plata1
31Rojo1
32Negro1

Lo que quiero hacer es seleccionar los ID que contienen el color Rojo, Negro y Amarillo, (seleccione esos ID con sus respectivos otros elementos).

En este caso, el resultado podría ser una nueva columna o una nueva tabla que contenga los resultados deseados.

¿Es posible usar DAX?

He intentado aplicar primero un grupo por, y luego filtrar usando &&, sin embargo mis resultados están lejos de lo deseado.

1 ACCEPTED SOLUTION

@Raulx_7 mejor explicación y aquí está el dax para crear una nueva tabla

New Color = 
CALCULATETABLE ( 
    Color,
    FILTER (
        SUMMARIZE (
            ALL ( Color[ID] ),
            Color[ID],
            "__row", COUNTROWS ( Color )
        ),
        [__row] > 0
    )
)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



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.

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Raulx_7 , Busque la solución adjunta después de la firma. Todos los usados esperan medirlo y filtrarlo en la tabla de cálculo.

parry2k
Super User
Super User

@Raulx_7 no está seguro de lo que está tratando de achive, pero puede crear una nueva tabla con la siguiente expresión

New Table = FILTER ( Table, Table[Object Name] IN  { "Red", "Black", "Yellow" } )

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



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.

Quiero una nueva tabla con esos ID que contenga todos los valores específicos y sus otros valores. por ejemplo, utilizando la tabla anterior, el resultado deseado es:

IdObjeto IDObjetoValor del objeto
11Rojo1
12Negro2
13Amarillo1
14Azul1
21Rojo2
22Negro1
23Amarillo1
24Azul1
25Marrón2
26Plata1

El ID 3 no está incluido porque no contiene el 3 elemento deseado (rojo, negro y amarillo), el ID 1 y 2 están allí con todos sus elementos.

Hola @Raulx_7 ,

1. Cree dos columnas calculadas.

Color marking = 
SWITCH(
    [Object name],
    "Red", 1,
    "Black", 1,
    "Yellow", 1,
    0
)
Sum of color marking = 
CALCULATE(
    SUM([Color marking]),
    ALLEXCEPT( Sheet2, Sheet2[ID])
)

6b.PNG

2. Cree una tabla calculada.

Table = 
SUMMARIZE(
    FILTER(
        Sheet2,
        Sheet2[Sum of color marking] = 3
    ),
    Sheet2[ID], Sheet2[Object ID], Sheet2[Object name], Sheet2[Object value] 
)

7b.PNG

Saludos
Lionel Chen

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

@Raulx_7 su lógica no está clara, usted mencionó para elegir rojo negro amarillo y ahora usted está diciendo diferente color, ¿cuál es la lógica para elegir los colores. plese explicar.



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.

(Rojo, Negro y Amarillo) es el filtro que quiero aplicar, Si el ID tiene esos 3 entonces incluya todos sus elementos

(los datos originales no son colores, simplemente los sustituyo para publicarlos aquí)

Para que sea claro:

- primero comprobar si el id tiene esos colores)

si el id contiene Rojo && Negro && Amarillo, mantenga ese ID con todos los valores dentro (puede tener más que esos colores)

- Si el ID no tiene rojo && Negro && Amarillo, entonces borre.

@Raulx_7 mejor explicación y aquí está el dax para crear una nueva tabla

New Color = 
CALCULATETABLE ( 
    Color,
    FILTER (
        SUMMARIZE (
            ALL ( Color[ID] ),
            Color[ID],
            "__row", COUNTROWS ( Color )
        ),
        [__row] > 0
    )
)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



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.

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.