Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hola
Estoy buscando buscar una columna de tabla (texto) con palabras clave de otra tabla y vincularla a esa nueva tabla, esencialmente creando agrupaciones útiles a partir de las palabras clave. He encontrado varios ejemplos útiles en este foro, pero ninguno llega al fondo de mi problema. Usaré un ejemplo de la comunidad.
Keyword_FACT
Palabra clave | Tipo |
Módulo | Contenido |
Seminario | Contenido |
Clase | Contenido |
Lectura | Contenido |
Lección | Contenido |
Académico | Personal |
Administradores | Personal |
Personal | Personal |
Profesores | Personal |
Reference_FACT
Género | Departamento | Comentario |
M | Clásicos | Las conferencias y las lecciones son muy buenas. |
M | Biología | |
M | Clásicos | Me encanta el personal. |
F | Clásicos | Me divertí. |
M | Física | Los académicos son geniales |
F | Biología | Conferencias agradables |
M | Clásicos | El personal ofrece grandes seminarios |
uare DAX
Keyword =
CONCATENATEX(
'Keywords_FACT',
IF(
SEARCH('Keywords_FACT'[Keyword], 'Reference_FACT'[Comment],,999) <> 999,
'Keywords_FACT'[Keyword] & " ",
""
)
)
Y
Type =
CONCATENATEX(
'Keywords_FACT',
IF(
SEARCH('Keywords_FACT'[Keyword], 'Reference_FACT'[Comment],,999) <> 999,
'Keywords_FACT'[Type] & " ",
""
)
)
resultados en
GenderDepartment CommentKeywordType
Género | Departamento | Comentario | Palabra clave | Tipo |
M | Clásicos | Las conferencias y las lecciones son muy buenas. | clase de conferencia | contenido de contenido |
M | Biología | |||
M | Clásicos | Me encanta el personal. | Personal | Personal |
F | Clásicos | Me divertí. | ||
M | Física | Los académicos son geniales | Académico | Personal |
F | Biología | Conferencias agradables | Lectura | Contenido |
M | Clásicos | El personal ofrece grandes seminarios | personal del seminario | personal de contenido |
Así que ahora puedo usar la columna Tipo para filtrar mis datos sin embargo, si tengo varias palabras clave en diferentes "tipos" me desengancho (por ejemplo, la fila final en el ejemplo anterior). No quiero crear filas adicionales (no quiero duplicar ningún dato).
Me gustaría filtrar por contenido o personal y tener la fila final disponible en ambos
Si alguien puede pensar en una solución útil sería genial.
(como un aparte creo que podría ser útil convertir el DAX en la consulta de energía si eso también se pudiera hacer)
Solved! Go to Solution.
Hola, @avsparry
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Puede crear una medida como se indica a continuación.
Visual Control =
var x =
COUNTROWS(
FILTER(
DISTINCT('Table'[Type]),
CONTAINSSTRINGEXACT(MAX(Reference_FACT[Type]),[Type])
)
)
return
IF(
ISFILTERED('Table'[Type]),
IF(
x>0,
1,0
),
1
)
Por último, debe colocar la medida en el filtro de nivel visual para mostrar el resultado.
Saludos
Allan
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola, @avsparry
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Puede crear una medida como se indica a continuación.
Visual Control =
var x =
COUNTROWS(
FILTER(
DISTINCT('Table'[Type]),
CONTAINSSTRINGEXACT(MAX(Reference_FACT[Type]),[Type])
)
)
return
IF(
ISFILTERED('Table'[Type]),
IF(
x>0,
1,0
),
1
)
Por último, debe colocar la medida en el filtro de nivel visual para mostrar el resultado.
Saludos
Allan
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@avsparry aquí tienes, solución adjunta. Creo que hay algunas cosas donde puedo mejorar, pero por ahora, está bien. Creo que tengo que pasar más tiempo trabajando con List.Intersect para una solución más elegante.
Consulta mi última entrada de blog Año-2020, Pandemia, Power BI y más allá para obtener un resumen de mis versiones favoritas de las características de Power BI en 2020
Me gustaría ❤ elogios si mi solución ayudara. 👉 Si puedes dedicar tiempo a publicar la pregunta, también puedes hacer esfuerzos para dar Felicitaciones a quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas 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.
Sólo otro comentario. He intentado usar esta solución en mi conjunto de datos real (que es mucho más grande) y es significativamente más lento que usar DAX. ¿Tiene este problema también?
Me temo que no podré enviarle este conjunto de datos
No @parry2k
Esto funciona para mí y ordena mover el problema a la consulta de energía, ¿tiene algún consejo sobre cómo filtrar por tipo ahora lo tenemos en este formato?
Salud
ps Me gusta esta solución, voy a tratar de conseguir mi cabeza alrededor de todos los bits, para cualquier persona que no quiere descargar el pbix, es necesario crear esta función y luego utilizar en addcolumn en su tabla de datos.
(searchText as text, ignoreCase) =>
let
SplitSearchTextToList = Text.Split(searchText," "), //split search text by space
searchList = Table.Column(Keywords_FACT, "Keyword"), //get list of keywords
typeList = Table.Column(Keywords_FACT,"Type"), //get list of keywords type
SearchPos = List.Transform(SplitSearchTextToList,each
List.PositionOf( searchList, _, 0,(searchText,searchValue) => let newsearchText = if ignoreCase then Text.Lower(searchText) else searchText, newsearchValue = if ignoreCase then Text.Lower(searchValue) else searchValue in Text.Contains(newsearchValue,newsearchText))), //search each search word in the keyword list and get the list of search position
RemovePos = List.RemoveItems(SearchPos,{-1}), //remove not found search position
GetKeywords = Text.Combine(List.Transform(RemovePos,each searchList{_}),","), //get list of keywords based on the search position
GetType = Text.Combine(List.Transform(RemovePos,each typeList{_}),","), //get list of type based on the saarch position
#"Keywords and Type" = [Keywords=GetKeywords,Type=GetType] //create a record of keyword and type
in
#"Keywords and Type"
@avsparry también puede compartir el archivo de Excel que utilizó en pbix ya que voy a hacer la transformación en PQ y necesita archivo de datos.
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.
@avsparry Creo que será fácil de hacer en PQ que DAX y tengo que volver atrás y mirar una de mis soluciones donde hice algo similar. Puede colocar estos datos de ejemplo en un archivo pbix y compartirlos con una unidad drive/google.
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.
No @parry2k
gracias por echar un vistazo a esto, aquí hay un enlace al ejemplo https://www.dropbox.com/s/qgjslguu4v1bgsl/communityexample.pbix?dl=0
He estado tratando de implementar algo en PQ, pero no soy lo suficientemente bueno en ello. Realmente interesado en ver su solución.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |