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

Tabla de fechas no se carga en la consulta de energía para la transformación

Hola a todos,

He creado un escritorio de tabla de calendario con Power BI Desktop

• CALENDARIO (FECHA(2011,1,1),DATE(2020,12,31))
Genera la fecha, pero cuando intento cargarla en la consulta de energía no aparece.
También traté de marcarlo como Tabla de Fechas. Pero no aparece en Power Query.
Cualquier ayuda sería muy apreciada
1 ACCEPTED SOLUTION
Watsky
Solution Sage
Solution Sage

@prkhan56 No estaba seguro de si quería crear una tabla de fechas en Power Query, pero ésta es la que utilizo:

let
    Source = #date(2011, 1, 1),Encoding = 65001,
    #"Convert to List" = List.Dates(Source, Number.From(#date(2020,12,31))-Number.From(Source),#duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(#"Convert to List", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Column to Date" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date Range"}}),
    #"Changed Type to Date" = Table.TransformColumnTypes(#"Renamed Column to Date",{{"Date Range", type date}}),
    #"Inserted Year" = Table.AddColumn(#"Changed Type to Date", "Year", each Date.Year([Date Range]), Int64.Type),
    #"Inserted Start of Year" = Table.AddColumn(#"Inserted Year", "Start of Year", each Date.StartOfYear([Date Range]), type date),
    #"Inserted End of Year" = Table.AddColumn(#"Inserted Start of Year", "End of Year", each Date.EndOfYear([Date Range]), type date),
    #"Inserted End of Month" = Table.AddColumn(#"Inserted End of Year", "End of Month", each Date.EndOfMonth([Date Range]), type date),
    #"Inserted Month Name" = Table.AddColumn(#"Inserted End of Month", "Month Name", each Date.MonthName([Date Range]), type text),
    #"Inserted Start of Week" = Table.AddColumn(#"Inserted Month Name", "Start of Week", each Date.StartOfWeek([Date Range]), type date),
    #"Inserted End of Week" = Table.AddColumn(#"Inserted Start of Week", "End of Week", each Date.EndOfWeek([Date Range]), type date),
    #"Duplicated Column" = Table.DuplicateColumn(#"Inserted End of Week", "Date Range", "Weekday"),
    #"Create Weekday" = Table.TransformColumns(#"Duplicated Column", {{"Weekday", each Date.DayOfWeekName(_), type text}}),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Create Weekday", "Date Range", "Week of Year"),
    #"Calculated Week of Year" = Table.TransformColumns(#"Duplicated Column1",{{"Week of Year", Date.WeekOfYear, Int64.Type}}),
    #"Inserted Quarter" = Table.AddColumn(#"Calculated Week of Year", "Quarters",  each  "Q" & Number.ToText(Date.QuarterOfYear([Date Range])),type text),
    #"Inserted End of Quarter" = Table.AddColumn(#"Inserted Quarter", "End of Quarter", each Date.EndOfQuarter([Date Range]), type date)
in
    #"Inserted End of Quarter"


¿Mi(s) respuesta(s) le ayudó? Dale un kudos haciendo clic en Thumbs Up! ?
¿Mi publicación respondió a tu(s) pregunta(s)? Marca mi puesto como solución. Esto ayudará a otros a encontrar la solución.


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Watsky
Solution Sage
Solution Sage

@prkhan56 No estaba seguro de si quería crear una tabla de fechas en Power Query, pero ésta es la que utilizo:

let
    Source = #date(2011, 1, 1),Encoding = 65001,
    #"Convert to List" = List.Dates(Source, Number.From(#date(2020,12,31))-Number.From(Source),#duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(#"Convert to List", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Column to Date" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date Range"}}),
    #"Changed Type to Date" = Table.TransformColumnTypes(#"Renamed Column to Date",{{"Date Range", type date}}),
    #"Inserted Year" = Table.AddColumn(#"Changed Type to Date", "Year", each Date.Year([Date Range]), Int64.Type),
    #"Inserted Start of Year" = Table.AddColumn(#"Inserted Year", "Start of Year", each Date.StartOfYear([Date Range]), type date),
    #"Inserted End of Year" = Table.AddColumn(#"Inserted Start of Year", "End of Year", each Date.EndOfYear([Date Range]), type date),
    #"Inserted End of Month" = Table.AddColumn(#"Inserted End of Year", "End of Month", each Date.EndOfMonth([Date Range]), type date),
    #"Inserted Month Name" = Table.AddColumn(#"Inserted End of Month", "Month Name", each Date.MonthName([Date Range]), type text),
    #"Inserted Start of Week" = Table.AddColumn(#"Inserted Month Name", "Start of Week", each Date.StartOfWeek([Date Range]), type date),
    #"Inserted End of Week" = Table.AddColumn(#"Inserted Start of Week", "End of Week", each Date.EndOfWeek([Date Range]), type date),
    #"Duplicated Column" = Table.DuplicateColumn(#"Inserted End of Week", "Date Range", "Weekday"),
    #"Create Weekday" = Table.TransformColumns(#"Duplicated Column", {{"Weekday", each Date.DayOfWeekName(_), type text}}),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Create Weekday", "Date Range", "Week of Year"),
    #"Calculated Week of Year" = Table.TransformColumns(#"Duplicated Column1",{{"Week of Year", Date.WeekOfYear, Int64.Type}}),
    #"Inserted Quarter" = Table.AddColumn(#"Calculated Week of Year", "Quarters",  each  "Q" & Number.ToText(Date.QuarterOfYear([Date Range])),type text),
    #"Inserted End of Quarter" = Table.AddColumn(#"Inserted Quarter", "End of Quarter", each Date.EndOfQuarter([Date Range]), type date)
in
    #"Inserted End of Quarter"


¿Mi(s) respuesta(s) le ayudó? Dale un kudos haciendo clic en Thumbs Up! ?
¿Mi publicación respondió a tu(s) pregunta(s)? Marca mi puesto como solución. Esto ayudará a otros a encontrar la solución.


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

parry2k
Super User
Super User

@prkhan56 si ha creado una tabla mediante la expresión DAX, no se mostrará en PQ. Puedes crear un calendario usando PQ, hay un montón de publicaciones sobre cómo crear uno.

Consulta mi última entrada de blog Año-2020, Pandemia, Power BI y más allá para obtener un resumen de mis versiones favoritas de las características de Power BI en 2020

Me gustaría elogios si mi solución ayudara. 👉 Si puedes dedicar tiempo a publicar la pregunta, también puedes hacer esfuerzos para dar Felicitaciones a quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.