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.
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:
Id | ID de objeto | Nombre del objeto | Valor del objeto |
1 | 1 | Rojo | 1 |
1 | 2 | Negro | 2 |
1 | 3 | Amarillo | 1 |
1 | 4 | Azul | 1 |
2 | 1 | Rojo | 2 |
2 | 2 | Negro | 1 |
2 | 3 | Amarillo | 1 |
2 | 4 | Azul | 1 |
2 | 5 | Marrón | 2 |
2 | 6 | Plata | 1 |
3 | 1 | Rojo | 1 |
3 | 2 | Negro | 1 |
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.
Solved! Go to 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.
@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.
@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:
Id | Objeto ID | Objeto | Valor del objeto |
1 | 1 | Rojo | 1 |
1 | 2 | Negro | 2 |
1 | 3 | Amarillo | 1 |
1 | 4 | Azul | 1 |
2 | 1 | Rojo | 2 |
2 | 2 | Negro | 1 |
2 | 3 | Amarillo | 1 |
2 | 4 | Azul | 1 |
2 | 5 | Marrón | 2 |
2 | 6 | Plata | 1 |
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])
)
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]
)
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |