Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

InfluxDB via REST API JSON

Hi, I'm trying to create a report based on InfluxDB Time Series data.

 

I can get data by quering it via rest api which returns a JSON like this:

 

{
  "results": [
    {
      "statement_id": 0,
      "series": [
        {
          "name": "check_local_disk",
          "columns": [
            "time",
            "crit",
            "hostname",
            "max",
            "metric",
            "service",
            "unit",
            "value",
            "warn"
          ],
          "values": [
            [
              "2019-02-19T15:27:09Z",
              24979072409.600002,
              "myhost",
              499581448192,
              "c:_",
              "Disk C",
              "bytes",
              79175041024,
              49958144819.200005
            ],
            [
              "2019-02-19T15:32:12Z",
              24979072409.600002,
              "otherhost",
              499581448192,
              "c:_",
              "Disk C",
              "bytes",
              79163670528,
              49958144819.200005
            ]
          ]
        }
      ]
    }
  ]
}

My Problem is that I dont know how to transform the Column Fields as Column Names of a table and add the values as rows.

Has somebody an idea on how to archive this?

Thanks.

2 REPLIES 2
Anonymous
Not applicable

Hi there, 

I am trying to connect PowerBI with influx DB on M language editor. 

let
body = Text.ToBinary("
'from(bucket:""test2"")
|> range(start: -12h)
|> filter(fn: (r) => r._measurement == ""temperature"")
|> aggregateWindow(every: 1h, fn: mean)'
"),
url = "http://20.xx.xx.xx:8086",
options = [
Headers = [
Authorization=" Token pcSpeRixxxxxxxxxxxxxxxxxxxxxxxxxxpN1QQ2oQTuQ==",
Accept="application/json",
Content="application/json"],
RelativePath="api/v2/query",

Query=[org="xxxxx"],
Content=body
],
result = Web.Contents(url, options)

in
result

 

 

but it shows this error:

Web.Contents with the Content option is only supported when connecting anonymously.

 

 

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

When you connect to InfluxD with Power BI Desktop, does it show JSON code as below in the Power BI Desktop?

Or conenct to this json file into Power BI Desktop?

 

In addition,

You could follow this article to use the OData REST API to access InfluxDB data.

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.