6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Power Queryでカレンダー

Posted at

単なる作成例。詳細エディタに貼って使えます。

##ただの日付と曜日のリスト
終了日を定め、そこから遡る方式にしてみました。

カレンダー生成
(カレンダー終了日 as date,遡る年数 as number) as table=>
let
    Source = List.Generate(
                    ()=>[日付=Date.AddYears(カレンダー終了日,-遡る年数),曜日=Date.DayOfWeekName(日付)],
                    each [日付]<=カレンダー終了日,
                    each [日付=Date.AddDays([日付],1),曜日=Date.DayOfWeekName(日付)]
             ),
    Custom = Table.FromRecords(Source)
in
    Custom

詳細エディタに貼ると、こんなかんじに。
関数画面.png

日付とか入れて、「呼び出し」すると、こんなかんじ。
呼出し語.png

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?