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
Nino_Birdie
Frequent Visitor

Repetir filas x veces para wordcloud

2020-04-01 22_59_10-Workplaz v2 - Power BI Desktop.png

Así que tengo esta tabla con conceptos, el id y la puntuación . Necesito repetir por ejemplo la primera fila con el concepto y el id, 4 veces, la segunda sólo 1, la tercera 4, y así sucesivamente. Porque necesito hacer un wordcloud visual con estos datos para hacer el concepto más grande basado en las veces que se repite. El objeto visual DEBE ser una nube de palabras, así que no puedo cambiarlo.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hola

Este código M hace el trabajo

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTK0BBImSrE60UrBMK4hmOuCKuuKyg2BcY3B3EgY1wjM9UM1ygPIMrNAqPaC8yHyTnC+mVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Concepts = _t, ID = _t, Score = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Concepts", type text}, {"ID", Int64.Type}, {"Score", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {1..[Score]}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Score", "Custom"})
in
    #"Removed Columns"

Espero que esto ayude.

Untitled.png


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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User
Ashish_Mathur
Super User
Super User

Hola

Este código M hace el trabajo

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTK0BBImSrE60UrBMK4hmOuCKuuKyg2BcY3B3EgY1wjM9UM1ygPIMrNAqPaC8yHyTnC+mVJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Concepts = _t, ID = _t, Score = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Concepts", type text}, {"ID", Int64.Type}, {"Score", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {1..[Score]}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Score", "Custom"})
in
    #"Removed Columns"

Espero que esto ayude.

Untitled.png


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

¡Muchas gracias! ¡Esto hizo lo que necesitaba!

De nada.


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

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.

Top Solution Authors