0
1

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 3 years have passed since last update.

PowerBI: 日付への変換

Posted at

背景

質問があったので、分かりやすいようにしてみた。

Power Query

元データ

image.png

対象 TransformColumnTypesで変換 補足
"yyyy/MM/dd" Text 2019/01/01
"yyyy-MM-dd" Text 2019-01-01
"yyyyMMdd" Text 20190101
yyyyMMdd nubmer 20190101 × ↑ Textで変換出来るので、先に型変換すれば OK
image.png

DAX

image.png

対象 datevalueで変換 Date で変換
"yyyy/MM/dd" Text 2019/01/01 -
"yyyy-MM-dd" Text 2019-01-01 -
"yyyyMMdd" Text 20190101 × Year/Month/Day に分割して Date() で変換
yyyyMMdd nubmer 20190101 × Year/Month/Day に分割して Date() で変換

image.png
分割が Text なら Left/Mid/Right で、数字は計算で。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?