カレンダーに基づく時間インテリジェンス: 時間インテリジェンス、カスタマイズ版 (プレビュー) | Microsoft Power BI ブログ

ビジネスインテリジェンスの中心にあるのは時間ベースの分析です。Power BIは時間に基づく計算をサポートしていますが、いくつかの制約があります。新たに導入されたカレンダーに基づく時間インテリジェンスは、様々なカレンダーストラクチャーに対応しています。各テーブルに複数のカレンダーを定義でき、適切な時間分析が可能です。週単位の計算や不規則なカレンダーのサポートも強化されています。さらに、DAX関数でカレンダーを使用することで、精度の高い分析が実現します。

カレンダーを基にした時間インテリジェンスの導入

ビジネスインテリジェンスの中心には、時間ベースの分析があります。2年前の売上を比較したり、先月のパフォーマンスを分析したり、現在の四半期の合計を計算する際には、時間インテリジェンスが不可欠です。Power BIは長い間、時間ベースの計算をサポートしてきましたが、既存の関数にはいくつかの制約があります。

既存の制約

  • 週ベースの計算に対するサポートがない
  • 連続した日付テーブルを必要とする
  • 非グレゴリオ暦(例:会計年度、月のカレンダー、小売カレンダー)に対する柔軟性が限られている

ここで、カレンダーを基にした時間インテリジェンスが登場します。この機能により、Power BIで任意のカレンダー構造を用いて効果的に作業できるようになります。

カレンダーとは?

Power BIでは、カレンダーはテーブル内のどの列が特定の時間属性を表すかを定義します。これにより、カスタマイズされた時間ベースの分析が可能となります。任意のテーブルに複数のカレンダーを定義することで、時間のセグメント化や分析方法を完全にコントロールできます。

主要な利点

  • すべてのカレンダーに対応:グレゴリオ暦、シフトされたグレゴリオ暦、小売(445、454、544)、13ヶ月、月のカレンダーなど
  • 構造的ルールのない設計:Power BIは構造的なルールを課さないため、カレンダーは必要に応じてカスタマイズ可能
  • まばらな日付サポート:連続した日付テーブルは推奨されますが、必須ではありません
  • 週ベースの計算が可能:新しい関数TOTALWTD(週から日までの合計)を使用することで、週レベルの分析が容易になります
  • パフォーマンスの向上:特定のシナリオでは、従来の時間インテリジェンス関数に比べてパフォーマンスが向上する可能性があります

使い始めるには

プレビュー機能を有効にするには、次の手順を実行します:

  1. オプションと設定 > オプション > プレビューフィーチャーに移動
  2. “強化されたDAX時間インテリジェンス”をオンにする

有効化後、カレンダーを定義するためには、カレンダーオプションのユーザーインターフェースまたはTMDLビューツールを使用できます。

カレンダーの定義

カレンダーオプションUIの利用

テーブルツールタブからまたはデータペインでテーブルを右クリックしてカレンダーオプションにアクセスできます。

  • 既存のカレンダーを表示
  • 新しいカレンダーを作成
  • テーブルを日付テーブルとしてマークするオプションにアクセス

カレンダーは、カテゴリと列のマッピングから構成されます。各カテゴリには主列が必要で、関連列を含むことも可能です。例えば、会計年度カレンダーは次のように定義されるかもしれません:

  • 年 → 会計年度
  • 四半期 → 会計四半期
  • 月 → 会計月
  • 日 → 会計日

完全カテゴリと部分カテゴリ

  • 完全カテゴリは特定の時間期間を一意に識別(例:“2024年1月” → 月)
  • 部分カテゴリは一意に識別しない(例:“1月” → 年の月)

Power BIでは特定の言語やフォーマットは必要ありません。重要なのは列間のカーディナリティです。

検証ルール

カレンダーを保存する前に、以下の点を確認します:

  • カレンダー名が一意であること
  • 列が複数のカテゴリに割り当てられていないこと
  • 部分カテゴリが完全カテゴリとペアになっていること(例:四半期における日や年)
  • 列がカレンダー間で一貫して分類されていること

データの検証ボタンを使用して、空白値やカーディナリティの問題を確認できます。

高度な機能:TMDLビューの利用

TMDLビューを使用すると、時間に関連する列にタグを付けることができ、より柔軟な定義が可能になります。

例:

table Date

...

calendar 'デモ カレンダー'

カレンダーColumnGroup = year

主な列:Year

カレンダーColumnGroup = month

主な列:Month

関連列:DutchMonthName

関連列:MonthName

列: 'Holiday Name'

列: isWorkingDay

このデモカレンダーは、次のマッピングを定義します:

  • 年カテゴリには主列Year
  • 月カテゴリには主列Monthと2つの関連列(DutchMonthNameとMonthName)

さらに、カレンダーに基づいた時間関連関数の利用が可能になります。

今日から試してみよう!

カレンダーを基にした時間インテリジェンスは、比類のない柔軟性を提供し、組み込み関数を使用した週ベースの計算を唯一無二の方法で行うことができます。プレビューを今日有効にし、その可能性を探求してください。詳細については、こちらのドキュメントをご覧ください。あなたの感想をお聞かせください!

————-

Calendar-based time intelligence: time intelligence, tailored (Preview) | Microsoft Power BI Blog

Source link

Summary: Calendar-Based Time Intelligence in Power BI

Time-based analysis is crucial in business intelligence, enabling comparisons across different time frames (e.g., year-over-year sales, monthly performance). While Power BI supports time-based calculations, it has limitations, such as the lack of week-based calculations and the need for a continuous date table.

Introduction of Calendar-Based Time Intelligence
A new feature in Power BI allows users to implement flexible calendar structures for time-based analysis, regardless of the calendar format.

What Are Calendars?

In Power BI, calendars categorize time attributes in tables, allowing customized time analysis. You can create multiple calendars in a single table for varied time segmentation.

Key Benefits

  • Multiple Calendar Types Supported: Works with Gregorian, shifted Gregorian, retail, lunar, and more.
  • No Structural Assumptions: Custom calendars can be defined without imposed formats.
  • Sparse Dates: Continuous date tables are not mandatory.
  • Easy Week-Based Calculations: New functions like TOTALWTD simplify week-level analysis.
  • Performance Gains: Some scenarios may improve performance compared to traditional functions.

Getting Started

To enable calendar-based time intelligence, users need to activate it in Power BI’s preview features.

Defining a Calendar

You can define calendars using the Calendar options interface or the TMDL (Tabular Model Definition Language) view. A calendar is created by mapping time attributes (e.g., year, quarter, month) to specific columns.

Categories:

  • Complete categories uniquely identify time periods (e.g., “January 2024”).
  • Partial categories do not uniquely identify them (e.g., “January”).

Validation Rules

Ensure that:

  • Calendar names are unique.
  • No columns are duplicated across categories.
  • Partial categories are paired with complete ones.

Advanced Usage: TMDL View

This view allows further flexibility, such as tagging columns as time-related. Columns can be mapped for time intelligence calculations, influencing how they behave in DAX functions.

Using Calendars in DAX

Once defined, calendars can be referenced in all time functions. For example, new week-based calculations can be performed with functions like TOTALWTD.

Conclusion

Calendar-based time intelligence enhances flexibility in Power BI, enabling comprehensive week-based analysis and overcoming previous limitations. Enable this feature for an improved experience in time-based analysis.

関連記事