close

Lesson 4  Integrate Power BI


In Lesson 3 , we used sample code connect to NAS .In this lesson, you will learn how yo use Power BI visualize sensor data that NAS recive in real-time.

There are four parts:

A: Get your first Power BI account

B: Setup your streaming dataset API

C: Configure Node-RED’s nodes in IoT application

D: Add tile to display real-time data

Part A: Get your first Power BI account



power_bi_index





  •  After registering, the page will lead you to the below page. Click "My workspace", and then click "Skip for now".


    start


Part B: Setup your streaming dataset API



  • Create "Datasets"

    • Click "Create" in the top-right corner

    • Click "Streaming dataset"




create_datastream


  • Select "API", the source of your data, and click "Next".




API

  • Define your values from stream (such as temp, max, min), and you will get a JSON result in the textbox. We will use this JSON code to push data to the QIoT Suite Lite application. Click "Create" to finish.


edit_streaming_dataset

  • Once you create your data stream, you get a REST API URL which IoT applications can call using POST requests to push your live data to the streaming data dataset you created.


push_url

Part C: Configure Node-RED’s nodes in your IoT application



  • Create an IoT application in QIoT Suite.

  • The following is your first Node-RED flow, and then you can start creating your own IoT flow. You can learn more about Node-RED at https://nodered.org/


Node-Red

  • Before you start pushing live data to Power BI. We need a "function" node to convert IoT data to a streaming data dataset. Here you can replace payload to your JSON dataset.


msg.payload

  • Enter the code as following:
    msg.payload=[{
    "temp":msg.payload.value,
    "max":100,
    "min":0
    }]
    return msg;


  • We need an "http request" node to help us to push live data to Power BI. Drag and drop the "http request" node and connect it to the tail of the "function" node.


http request

  • Copy and paste the REST API URL from the Power BI console, and set the http method to POST. Click "Deploy".


Deploy

  • Your Node-RED flow will look like below.



Finally node-red

Part D: Add tile to display real-time data



  • Create "Dashboard"

    • Click "Create" in the top-right corner

    • Click "Dashboard"

    • Enter the dashboard’s name, and click "Create".




create_dashboard

dashboard_name

  • Click "Add tile" in the top-right corner


add_tile

  • Select "CUSTOM STREAMING DATA" and click the "Next".


CUSTOM STREAMING DATA

  • Select the datasets and click "Next".


datasets

Select a visualization type, and set the minimum and maximum value.
value



  • You will now have a streaming dataset to work with. You can get a real time gauge that looks as following.


streaming dataset

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 tttt 的頭像
    tttt

    觀察筆記

    tttt 發表在 痞客邦 留言(0) 人氣()