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

Create a new table depending on range

Hi there,

 

I want to create a new table depending on range, I got the following data;

Range.PNG

but I want to see it the following way;

range2.PNG    

Thanks in advanced.

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hola

Este código M funcionará

•Number.From([StartDate]).. Number.From([EndDate])

A continuación, expanda esta nueva columna.

Espero que esto ayude.


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

The solution send me the following error

Range3.PNG

 

Le faltan los corchetes al principio y al final.


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

Sorry, now I got the following error

range4.PNG

 

Hola

Comparte el enlace desde donde puedo descargar tu archivo PBI. Además, comparta el archivo MS Excel de copia de seguridad desde donde cargó datos en el archivo PowerBI.


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

Hola

Hay muchos archivos allí. ¿Cuál tengo que descargar? Además, asegúrese de que toda la información de sus archivos está en inglés. No entiendo español.


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

Re-send you the link
https://gcgcia-my.sharepoint.com/:f:/g/personal/vgarcia_d4b_mx/Emx1ZrC0U2hBnkLu7_XJw0cByx9KiC0YmdUjS...
There are only 2 files, a pbix and excel, both are in english.

 

 

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


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

Para ello, puede crear una nueva columna con una lista de las fechas entre la fecha de inicio y la fecha de finalización y, a continuación, expandir esa lista a nuevas filas. Vea el código M de ejemplo a continuación (tenga en cuenta que comencé en una configuración regional de fecha diferente, por lo que es posible que deba agregar un paso con mis datos de ejemplo para cambiar a la configuración regional). Para ver cómo funciona, simplemente cree una consulta en blanco, vaya a Editor avanzado y reemplace el texto allí con el código M a continuación.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ31DcyMDJQ0gEyjeFsIBGrE61khJA10jeygLFNgLKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [StartDate = _t, EndDate = _t, Rate = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"StartDate", type date}, {"EndDate", type date}, {"Rate", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Dates", each List.Dates([StartDate], Duration.TotalDays([EndDate]-[StartDate])+1, #duration(1,0,0,0))),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Dates", "Rate"}),
    #"Expanded Dates" = Table.ExpandListColumn(#"Removed Other Columns", "Dates")
in
    #"Expanded Dates"

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.