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
Anonymous
Not applicable

Lugares de usuarios visitados

Hola, tengo algunos datos que quiero cambiar. No sé qué usar (Escritorio o Consulta). Necesito ayuda para el siguiente:

Datos:

RegistroUsuarioLugar
01/01/2020AMex
01/01/2020BMex
02/01/2020CE.e.u.u
02/01/2020Aenlatar
02/01/2020B

E.e.u.u

04/01/2020BMex
05/01/2020CE.e.u.u
05/01/2020AUn montón de
06/01/2020Benlatar

Resultado:

UsuarioCo1Col2Col3
AMexenlatarUn montón de
BMexE.e.u.uenlatar
CE.e.u.u

Gracias.

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hola

Este código M funciona

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"CheckIn", type date}, {"User", type text}, {"Place", type text}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"CheckIn", Order.Ascending}}),
    #"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"CheckIn"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Columns"),
    Partition = Table.Group(#"Removed Duplicates", {"User"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
    #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Place", "Index"}, {"Place", "Index"}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Partition", {{"Index", type text}}, "en-IN"), List.Distinct(Table.TransformColumnTypes(#"Expanded Partition", {{"Index", type text}}, "en-IN")[Index]), "Index", "Place")
in
    #"Pivoted Column"

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur ¿qué puedo hacer con un archivo csv?

Hola @LuisELopez ,

En el apéndice encontrará la solución con una fuente CSV.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hola @LuisELopez ,

si mi solución te ayudó, por favor marca mi puesto como una solución.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hola @LuisELopez ,

también debería funcionar con un archivo CSV.
¿Puedes compartir el CSV?

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Gracias. Funciona.

Cuando intento hacer lo mismo con un csv, no es posible.

¿Qué puedo hacer?.

Realmente @Ashish_Mathur ?
¿Puede explicarme cuál es la mejora o el edvantage a mi respuesta?

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


No comprobas tu respuesta antes de publicar la mía.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Tal vez la próxima vez.
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hola @LuisELopez

eche un vistazo al archivo PBIX adjunto.

Aquí puede encontrar información sobre los pasos más importantes.

https://www.excelguru.ca/blog/2018/06/27/number-rows-by-group-using-power-query/

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Greg_Deckler
Super User
Super User

@ImkeF


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.