Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ゴール

Use the API to build a simple dashboard in PowerBI showing me the areas by department and how many rooms have the various RDS statuses associated with them.

Figuring out what data to export using the documentation and get request URL

First thing to do in order to figure out what data to export is to log into the open API documentation GUI for my database. Since the list of available attributes will vary depending on my database setup I have to login in. I then look into the Schemas section and expand Rooms and also the "more" properties below "< * >".

In this case I would like to report over "main" department only (root grouping) and the programmed and designed area so I note the following attributes:API を使用して、PowerBI でシンプルなダッシュボードを構築し、デパートメント (部門)ごとのエリアと、
それらに関連付けられたさまざまな RDS ステータスのある部屋の数を示します。

ドキュメンテーションとリクエストURLの取得を使用して、エクスポートするデータを特定する。

どのようなデータをエクスポートすべきかを把握するために最初にすべきことは、自分のデータベースのOpen APIドキュメンテーションGUI にログインすることです。
利用可能な属性のリストはデータベースの設定によって異なるため、ログインする必要があります。
次にスキーマのセクションに目を通し、部屋を展開し、"< * >"の下にある " さらに (more) " のプロパティも展開します。

この場合、"メイン" デパートメント(部門)のみ (ルート・グループ化)と、プログラム・エリア、設計エリアについてレポートしたいと思います、
そのため、以下の属性にご注意ください:

room_function_0_no
room_function_0_name
programmed_area
designed_area
rds_status_short 

Here I can then copy the Request URL directly that I can use in Power BI. In this case:ここでは、Power BI で使用できるリクエスト URL を直接コピーできます。この場合:

https://api-no.drofus.com/api/rooms?$select=room_function_0_no,room_function_0_name,programmed_area,designed_area,rds_status_short

...

PowerBI

...

デスクトップでデータを取得する

  1. Get Data → データ取得 (Get Data)→ Webから (From Web

  2. Paste the URL copied from above

  3. )。

  4. 上記でコピーしたURLを貼り付ける。

  5. ベーシック認証 (Basic Authentication) - choose ベーシック (basic (see Authentication for how to build username)

  6. Click "To Table"

  7. Click "Split columns"

  8. Click Apply and close

...

TIP - Changing data types

Sometimes PowerBI does not understand the datatype we get - so you have to tell it what it is. Right click on the query and select "Edit query". Right click on the columns in question and select "Change Type"

...

Example: Column chart with programmed vs designed area by department:

...

Example 2: Adding number of rooms by RDS status and programmed are by department

...

  1. )を選択 (ユーザー名の作成方法については “認証” を参照)。

  2. “テーブルへ (To Table)”をクリック。

  3. "列 (コラム)の分割 (Split columns)"をクリック。

  4. “適用 (Apply )”をクリックして閉じる。

...

ヒント - データ型の変更

PowerBI がデータ型を理解できないことがあります - そのため、データ型が何であるかをPowerBIに伝える必要があります。
クエリを右クリックし、”クエリの編集” を選択します。問題の列を右クリックし、”タイプの変更 (Change Type)“を選択します。

...

例:部門別のプログラム面積と設計面積の比較表:

...

例2:RDSのステータス別に部屋数を追加し、デパートメント (部門別)にプログラムする。

...