Skip to content

Instantly share code, notes, and snippets.

View SchreiberLars's full-sized avatar

Lars Schreiber SchreiberLars

View GitHub Profile
let
/*
Creating a list of monthnames...
format and language of the list can easily by changes by the last two parameters
*/
MonthsList = List.Transform(
{0..11},
each Date.ToText(#date(1900, 1, 1) + Duration.From(_ * 31), "MMMM", "en-Us")
),
Source = Excel.CurrentWorkbook(){[Name = "Datenbasis"]}[Content],
let
/*
Creating a list of monthnames... format and language of the list can
easily be changed by the last two parameters
*/
MonthsList = List.Transform({0..11}, each Date.ToText(#date(1900,1,1) +
Duration.From(_*31), "MMMM", "en-GB")),
Source = Excel.CurrentWorkbook(){[Name="Datenbasis"]}[Content],
let
/*
This is Bill's version of getting a list of months...
as this is not a critical part for the over all solution,
I just copied it into this solution as well
*/
List_AllMonths = List.Transform({0..11}, each Date.ToText(#date(1900, 1, 1) +
Duration.From(_ * 31), "MMMM", "en-Us")),
Source = Excel.CurrentWorkbook(){[Name="Datenbasis"]}[Content],
let fn = () =>
let
Quelle = Json.Document(Web.Contents("http://worldclockapi.com/api/json/cet/now")),
#"In Tabelle konvertiert" = Record.ToTable(Quelle),
#"Gefilterte Zeilen" = Table.SelectRows(#"In Tabelle konvertiert", each ([Name] = "currentDateTime")),
#"Geänderter Typ" = Table.TransformColumnTypes(#"Gefilterte Zeilen",{{"Value", type datetimezone}}),
Output = Table.TransformColumnTypes(#"Geänderter Typ",{{"Value", type datetime}})[Value]{0}
in
Output,