Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JeroenN
Advocate I
Advocate I

Crear una nueva tabla con series generadas

¡Hola!

Probablemente una pregunta muy simple, pero aún no he encontrado la respuesta.

Quiero crear un nuevo tabel que se base en los valores de una columna de una tabla existente (Tbl_rent) y 'add' 5 filas para cada valor en la columna Unit_Id (variable 'Escenario').

¡Gracias!

Jeroen

Tbl_Rent NUEVA MESA
Id de unidad Id de unidadEscenario
1001001 10010011
1001002 10010012
1001003 10010013
1001004 10010014
1001005 10010015
1001006 10010021
1001007 10010022
1001008 10010023
1001009 10010024
1001010 10010025
1001011 10010031
10010032
10010033
10010034
10010035
10010041

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JeroenN , Probar como

Crossjoin(all(Tbl_Rent[Unit Id]), generateseries(1,5))

View solution in original post

5 REPLIES 5
PhilipTreacy
Super User
Super User

Hola @JeroenN

Otra solución en Power Query para una buena medida.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwACGlWB0Y2wiJbYzENkFimyKxzZDY5khsCyS2JYJtaIDEBtobCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Unit Id" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each {1..5}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"

saludos

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


AlB
Super User
Super User

Hola @JeroenN

Esto se puede hacer en DAX también, pero yo recomendaría hacerlo en PQ. Coloque el siguiente código M en una consulta en blanco para ver los pasos.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwACGlWB0Y2wiJbYzENkFimyKxzZDY5khsCyS2JYJtaIDEBtobCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Unit Id" = _t]),

    #"Added Custom" = Table.AddColumn(Source, "Scenario", each List.Numbers(1,5)),
    #"Expanded Scenario" = Table.ExpandListColumn(#"Added Custom", "Scenario")
in
    #"Expanded Scenario"

Por favor, marque la pregunta resuelta cuando haya terminado y considere dar un pulgar hacia arriba si las publicaciones son útiles.

Póngase en contacto conmigo de forma privada para obtener asistencia con cualquier necesidad de BI a gran escala, tutoría, etc.

Salud

SU18_powerbi_badge

Fowmy
Super User
Super User

@JeroenN

Cree una nueva tabla con el siguiente código:

New Table = 
GENERATE(
    Table,
    GENERATESERIES(1,5)
)

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@JeroenN , Probar como

Crossjoin(all(Tbl_Rent[Unit Id]), generateseries(1,5))

¡Gracias! Funciona perfectamente.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors