Traducir el blog
Power Query - multiple slicers (3/4)
In the previous post we saw a generic function that allows you to pivot a table in multiple rows:
In this post we will see a second version of that generic function, as published by Cameron Wallace on GitHub:
Third solution
This solution has its origin in the normalized detail table and, applying the generic function, it becomes a pivoted table with multiple rows if there is more than one location, age or skill per person.
This case cannot be solved with dynamic tables, since they do not admit several rows with the same Name.
The M code in Power Query for the generic function that pivot the table is as follows:
The way to call this function is:
= #"Pivot Duplicates Function"(TableDetails, "Type", "Details")
3 arguments are passed: Source as table, PivotCol as text and ValueCol as text.
The 5 steps applied by the generic function are explained below:
1) Source = Table.Buffer(Source)
//As source table is referenced 3 times, buffers the Source table in memory, isolating it from external changes during evaluation.
2) GroupClustIndex = Table.Group(Source,
List.RemoveItems(Table.ColumnNames(Source),{ValueCol}),
{"ColOfTables",each Table.AddIndexColumn(_,"idx")})
//Groups rows in the table that have the same key with List.RemoveItems function, adding an index column called "ColOfTables".
3) CombineTables = Table.Combine(GroupClustIndex[ColOfTables])
//Combine main table with the tables in the "ColOfTables" column.
4) Pivot = Table.Pivot(CombineTables,
List.Distinct(Table.Column(Source,PivotCol)), PivotCol, ValueCol)
//Pivot Source tabla with the PivotCol adding one column for each "Type" with the ValueCol from "Details" values.
5) RemoveIndex = Table.RemoveColumns(Pivot,{"idx"})
//Remove auxiliar index.
Third solution download
- From this link to Microsoft OneDrive:
- From this link to Sites Google Drive:
With the generic function, you cannot click individual steps and see how the query transforms the data, so a fourth solution is required.
You can read the following post talking about the last fourth solution, without the generic function and with only a few steps applied in Power Query:
Mi lista de blogs
-
¿En cuantas ternas pitagóricas? (1) - No todos los números naturales pueden ser hipotenusas o catetos en una terna pitagórica. Por ejemplo, el 23 no es ni uno ni otro. Otros números pertenec...Hace 1 día
-
Agenda Calendario Vintage - 🔝*To translate this blog post to your language, select it in the top left Google box. * Modo Agente de Excel para la Web Estos días puede que hayas...Hace 1 día
-
Atajos de Teclado en Excel para Activar tu Memoria Muscular - ¿Alguna vez has visto a alguien moverse tan rápido en Excel que parece que el teclado toca solo?No es magia. […] The post Atajos de Teclado en Excel para...Hace 2 días
-
Mandelbrot, Mojo, Numpy and Numba - I recently read an article about connecting Python to the new Mojo language: Python Can Now Call Mojo The article had some code examples, including code to...Hace 2 días
-
Do Your Excel Files Collapse Like Jenga Blocks? - Before we dig into Modern Excel, can you please help me out? What, exactly, is “Modern Excel”? I can’t find a standard definition on the Microsoft site, or...Hace 2 días
-
Power BI insertar cuadros de búsqueda en segmentacion - Hoy voy a explicaros como añadir un cuadro de búsqueda en una segmentación de power BI Para ello comenzamos con los datos de un excel como el que se mu...Hace 6 días
-
CÓMO INTEGRAR SORA DE AZURE AI FOUNDRY EN POWER AUTOMATE Y POWER APPS - Era cuestión de tiempo que intentase integrar el poder crear vídeos en Power Apps! Y lo he logrado utilizando el modelo Sora que existe en … La entrada ...Hace 1 semana
-
5 Ways to Get Rid of Extra Spaces in Microsoft Excel - Today, you’ll learn how to get rid of extra spaces in Microsoft Excel. This is a valuable skill to acquire. Stick to this guide and read until the end. Ext...Hace 2 semanas
-
Complementos Excel Guía completa y potencia tu hoja de cálculo - Vas a conocer Complementos Excel tanto de Microsoft Office como de terceros. Ya que Excel además de todas las utilidades y herramientas que contiene, pue...Hace 4 semanas
-
Who is my boss’s boss? [Data Analytics Challenge – 001] - Let’s try something different. I will share a data analytics challenge here. Post your solutions in the comments. Our first challenge involves Employee D...Hace 2 meses
-
Todo lo que debes saber sobre la función EVALUAR en Excel - Antes de empezar con este tema, te lo digo claro: No te recomiendo que uses la función EVALUAR en tus archivos de Excel. Y no… The post Todo lo que debes...Hace 2 meses
-
🛠️ Error Formula.Firewall en Power Query: ¿Qué es y cómo solucionarlo? - Power Query es una herramienta poderosa para transformar y combinar datos en Excel o Power BI. Sin embargo, en algunos escenarios comunes, puedes encontrar...Hace 2 meses
-
Cómo hacer gráficos en Excel - Excel es una de las herramientas más potentes y versátiles para el análisis y la presentación de datos. Los gráficos en Excel no solo ayudan a visualizar...Hace 6 meses
-
Fin - Llevo tiempo pensando esta entrada y no sé que decir. Analisis y Decisión nació en 2008 y no ... Leer más »Hace 8 meses
-
Análisis DAFO (FODA, DOFA) las decisiones con Excel - Para conocer la situación de una empresa, proyecto o persona, recurrimos al análisis DAFO (FODA, DOFA) en la toma de decisiones con Excel. El los años sese...Hace 10 meses
-
Color, Conditions, and Copilot: How to save time using conditional formatting with Copilot in Excel - Hi everyone, this is part 11 in a series of posts to show you some of the things that are possible to do with Copilot in Excel. *What is conditional f...Hace 11 meses
-
How To Predict Bearing Life With Excel - When you work in mechanical engineering, understanding the reliability and performance of bearings under various conditions is crucial. Bearings are the co...Hace 1 año
-
TikTok’s search evolution - 2 in 5 Americans use TikTok as a search engine. Nearly 1 in 10 Gen Zers are more likely to rely on TikTok than Google as a search engine. More than half of...Hace 1 año
-
Unblocking and Enabling Macros - When Windows detects that a file has come from a computer other than the one you're using, it marks the file as coming from the web, and blocks the file....Hace 2 años
-
Office Scripts: Trabajando con Tablas - [image: Office Scripts: Trabajando con Tablas] Me he dado cuenta que últimamente solo escribo de lenguaje M (es mi pequeño vicio)... pero hay que liberar l...Hace 2 años
-
Hello world! - [image: Hello world!] Welcome to WordPress. This is your first post. Edit or delete it, then start writing!Hace 2 años
-
La importancia de saber mecanografía en 2022 - [image: Resultado de imagen de mecanografía viñeta escribiendo a máquina] Según la RAE, la mecanografía es el arte de escribir a máquina. Hace unos cuantos...Hace 3 años
-
London Excel Meetup Workbooks - The workbooks used in my presentation on “Analytical and Interactive Dashboards in Excel” at the London Excel Meetup, September 3, 2020Hace 5 años
-
Cálculo de jornada que termina al día siguiente (Power Query) y despedida - [image: Cálculo de jornada que termina al día siguiente (Power Query) y despedida] Este blog se ha ocupado de cálculos de tiempo con bastante intensidad, c...Hace 5 años
-
Agenda Perpetua Excel Calendario Perpetuo - Saludos a los ingenieros y a todos los que forman parte de nuestra comunidad de planillas Excel para ingeniería civil, ya se vienen las fiestas navideñas y...Hace 5 años
-
International Keyboard Shortcut Day 2019 - The first Wednesday of every November is International Keyboard Shortcut Day. This Wednesday, people from all over the world will become far less efficient...Hace 5 años
-
Welcome, Prashanth! - Last March, I shared that we were starting to look for a new CEO for Stack Overflow. We were looking for that rare combination of someone who… Read more "W...Hace 6 años
-
Visualize parts and whole - combine clustered column and stacked column charts - *Inga: Disa what?* *Igor: -ppeared.* by The FrankensTeam ------------------------------ Really it was 3 years ago we posted our last article? *Freddy: Th...Hace 6 años
-
Salvador Sostres, analfabeto profesional - Los nuevos tiempos traen nuevas profesiones. Internet, además, ha revolucionado el mundo del periodismo y la palabra escrita. Adaptarse o morir, ese es el ...Hace 7 años
-
Planificación de compras - Realizar una lista con los productos que necesitamos y que formarán parte de nuestra cesta de la compra nos ayuda a *encontrar la combinación de bienes p...Hace 13 años
-
-
-
-
-
-
-
-
-
No Response to "Power Query - multiple slicers (3/4)"
Leave A Reply
Comenta este artículo, critícalo o avisa si detectas algún error que haya que corregir.