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
-
Análisis de Datos por Fechas y Horas en Excel - Cuando se trata de analizar datos, es común encontrarse con solicitudes que van más allá de simplemente agrupar por fecha. […] The post Análisis de Datos...Hace 2 días
-
Why Power Query Is the Excel Feature Engineers Can’t Ignore - If you find yourself buried under heaps of data with Excel as your go-to tool, then buckle up because we’re heading into the world of […]Hace 3 días
-
PLEASE UPDATE THE RSS FEED - The RSS feed URL you're currently using https://follow.it/excelunusual will stop working shortly. Please add /rss at the and of the URL, so that the URL ...Hace 3 días
-
PLEASE UPDATE THE RSS FEED - The RSS feed URL you're currently using https://follow.it/excel-foro-ejercicios-ejemplos-soluciones-dudas will stop working shortly. Please add /rss at t...Hace 3 días
-
PLEASE UPDATE THE RSS FEED - [image: PLEASE UPDATE THE RSS FEED] The RSS feed URL you're currently using https://follow.it/jldexcelsp will stop working shortly. Please add /rss at the...Hace 3 días
-
Excel Dependent Drop Down Lists – Block Changes - One of my favourite Excel features is a data validation drop down list. In just a couple of minutes, you can make a list of items, then make that list appe...Hace 3 días
-
Hipotenusas de cuaternas pitagóricas - Una cuaterna pitagórica es la expresión algebraica del teorema de Pitágoras en tres dimensiones, es decir, un conjunto de cuatro números enteros positivo...Hace 5 días
-
Excel Power Query: Obtener y transformar - Iconos más importantes de Obtener y transformar de Excel 2016: Obtener y transformar (Power Query) de Yolanda Cuesta Altieri Excel Power Query: Obtener y...Hace 5 días
-
CONTROLAR LOS TIEMPOS EN NUESTRAS APLICACIONES DE POWER APPS CON EL TEMPORIZADOR - Hola a todos! Cuanto realizamos programaciones es normal el uso de funciones para pausar la ejecución del código un determinado tiempo o para programarlo...Hace 1 semana
-
Let, Lambda, and py_Eval - I have covered the new Excel Let and Lambda functions before at: Two New Functions; Let and Lambda Eval and Let examples Lambda and VBA The Lambda function...Hace 1 semana
-
Conversor PGN de ajedrez mejorado - 🔝*Select the language of this blog post in the Google box at the top left. * Esta es la *4ª versión del Conversor PGN de ajedrez* que hago, cada uno ...Hace 1 semana
-
10 Ways to Count the Number of Occurrences in Microsoft Excel - Wondering how to count the number of occurrences in Excel? You’ve reached the right resource! Keep reading. Suppose, you’ve got a tabular dataset in your w...Hace 2 semanas
-
Announcing Power BI Dashboard Contest (win $500 prizes!) - Hey there, I have a SUPER exciting announcement! April is about to get a whole lot sweeter with our Power BI Dashboard Contest! Your mission, should you ...Hace 2 semanas
-
What's New in Excel (March 2024) - Welcome to our March 2024 update. This month, export to CSV and show details in PivotTables are now available in Excel for the web. Also, creating Power...Hace 3 semanas
-
Minutos de juego y puntos. El Espanyol, sus finales de partido y mis enfados - Pienso que el Espanyol este 2024 se está dejando muchos puntos al final de los partidos. Cuando el ... Leer más » The post Minutos de juego y puntos. El ...Hace 3 semanas
-
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 5 semanas
-
Aprende cómo usar la función #Filtrar con rangos de fechas SIN macros 📋 [VIDEO] - ¿Alguna vez te has preguntado cómo puedes filtrar tus datos por fechas específicas en Excel de manera rápida y eficiente? En este video, voy a enseñarte pa...Hace 1 mes
-
MASTERCLASS Gratis – Gráfica de Gestión Proyectos en #EXCEL. - Aprende a crear un Gráfico de CURVA S, ideal para GESTIÓN DE PROYECTOS, porque te permite identificar como esta tu proyecto tanto en COSTOS como en TIEMP...Hace 2 meses
-
Interés compuesto con Excel - En la imagen, se presenta un esquema de las distintas funciones Excel para calcular el valor del dinero en el tiempo mediante la capitalización compuesta...Hace 2 meses
-
Demos cursos de Excel 2007, 2010, 2013, 2016, 365 - Puedes consultar las demostraciones de los siguientes capítulos de los cursos Excel. Demo cursos ExcelHace 3 meses
-
El sistema operativo no está configurado para ejecutar esta aplicacion. - Si esta semana habéis recibido el mensaje "El sistema operativo no está configurado para ejecutar esta aplicacion" cuanto intentásteis abrir alguna aplic...Hace 7 meses
-
Atajos esenciales de Excel que todo profesional debe conocer - Manejar Excel con destreza puede ser el superpoder que no sabías que necesitabas. Agiliza tus tareas diarias y sorprende a tus colegas con estos atajos c...Hace 8 meses
-
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 1 año
-
-
Navigating Outlook Favorites - I have these four favorites defined in Outlook: From the inbox, I could hit Shift+F6 to get into the Favorites area but sometimes I would end up in no man’...Hace 1 año
-
Progress on the Block Protocol - Since the 1990s, the web has been a publishing place for human-readable documents. Documents published on the web are in HTML. HTML has a little bit of… Re...Hace 1 año
-
Decálogo para realizar Trabajos de Fin de Grado (TFGs) y de Fin de Máster (TFMs) - 1.- Tanto TFGs como TFMs son un requisito para graduarse a la vez que una oportunidad para aprender. Así, el tiempo que se le dedica es muy variable. De...Hace 2 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 3 años
-
Dimensiones-Propiedades de perfiles de acero (IMCA) - Saludos compañeros, en esta oportunidad compartimos esta Planilla Excel que contiene las Propiedades y dimensiones de diferentes tipos de perfiles de acero...Hace 4 años
-
-
-
-
-
-
No Response to "Power Query - multiple slicers (3/4)"
Leave A Reply
Dime si te gusta lo que lees y, si no te gusta, dime por qué. Tengo habilitada la moderación de comentarios. Tu comentario se publicará pronto.