Power BI (https://powerbi.microsoft.com/en-us/) is a business analytics service provided by Microsoft.
Here is the procedure to follow for pushing Live Tag data to Power BI :
- Create and configure the datastream :
step1.png (Size: 62,12 KB / Downloads: 462)
step2.png (Size: 15,39 KB / Downloads: 376)
createdatastream.png (Size: 18,59 KB / Downloads: 410)
- When the datastream is created, copy the URL
datastreamurl.png (Size: 9,56 KB / Downloads: 378)
- Adapt the following BASIC script with your URL and your Tags (in the Json) :
This script pushes the values of the Tags "Temperature" and "Humidity" every 5 seconds (See TSET command) :
tags.png (Size: 5,85 KB / Downloads: 340)
.
- Run the script
- Create a dashboard or a report
dashboard.png (Size: 20,36 KB / Downloads: 339)
PowerBIreport.png (Size: 34,22 KB / Downloads: 320)
Simon
Here is the procedure to follow for pushing Live Tag data to Power BI :
- Create and configure the datastream :
step1.png (Size: 62,12 KB / Downloads: 462)
step2.png (Size: 15,39 KB / Downloads: 376)
createdatastream.png (Size: 18,59 KB / Downloads: 410)
- When the datastream is created, copy the URL
datastreamurl.png (Size: 9,56 KB / Downloads: 378)
- Adapt the following BASIC script with your URL and your Tags (in the Json) :
Code:
PushInterval% = 5
ONTIMER 1, "GOTO PusDataToPowerBI"
PusDataToPowerBI:
TSET 1,0
Url$ = "https://api.powerbi.com/beta/5c7c1590-4488-4e42-bc9c-1f18f8ac994/datasets/4d71a553-1e92-4ba3-acdb-88ae5bf7d40b/rows?redirectedFromSignup=1"
Url$ = Url$ + "&noSignUpCheck=1&response=AlreadyAssignedLicense&redirectedWaitSimple=1&key=V2%2BGZCVK%2FQe%2F%2F64n6yKnEIoeipv31uBrQt8vtEvroWrV2Ha3qGEqeos4gmQen7PuplqojB%2F4J5S4gG0lzSceqQ%3D%3D"
method$ = "POST"
header$ = "Content-Type=application/json"
Json$ = '[{'
Json$ = Json$ + '"Temperature" :' + STR$ Temperature@ +","
Json$ = Json$ + '"Humidity" :' + STR$ Humidity@ +","
Json$ = Json$ + '"Timestamp" :"' + @GetTime$(2) +'"'
Json$ = Json$ +'}]'
PRINT Json$
@HttpRequest$(url$, method$, header$, Json$)
Print "Data Pushed"
TSET 1,PushInterval%
END
Function GetTime$($UTCDiff%)
$a$ = Time$
$GetTime$ = $a$(7 To 10) + "-" + $a$(4 To 5) + "-" + $a$(1 To 2) + "T" + STR$(VAL($a$(12 To 13)) - $UTCDiff%)+":"+$a$(15 To 16)+":"+$a$(18 To 19)+ ".000Z"
EndFn
FUNCTION HttpRequest$($URL_$, $Method_$, $Header_$, $data_$)
REQUESTHTTPX $URL_$, $Method_$, $Header_$, $data_$
$a% = GETSYS Prg,"ACTIONID"
$CHECKSCHEDULEACTION:
SETSYS Prg, "ACTIONID", $a%
$c% = GETSYS Prg,"ACTIONSTAT"
IF $c% = -1 THEN GOTO $CHECKSCHEDULEACTION
IF $c% = 0 THEN
PRINT TIME$ + " REQUEST OK on ActionID " + STR$ $a%
$StatusCode% = VAL RESPONSEHTTPX "STATUSCODE"
PRINT $StatusCode%
IF $StatusCode% = 200 THEN $HttpRequest$ = "OK" ELSE $HttpRequest$ = "NOK"
$Response$ = RESPONSEHTTPX "RESPONSE-BODY"
ELSE
PRINT TIME$ + " REQUEST FAILED on ActionID " + STR$ a%
$HttpRequest$ = "NOK"
ENDIF
ENDFNThis script pushes the values of the Tags "Temperature" and "Humidity" every 5 seconds (See TSET command) :
tags.png (Size: 5,85 KB / Downloads: 340)
.- Run the script
- Create a dashboard or a report
dashboard.png (Size: 20,36 KB / Downloads: 339)
PowerBIreport.png (Size: 34,22 KB / Downloads: 320)
Simon


