<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'. in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1722991#M52257</link>
    <description>&lt;P&gt;I don't see a way to do this. It seems the format is not valid JSON. Even when I manually remove the duplicate names, the next error is this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;So at best that file seems to be "json-ish" but not a true JSON file. Perhaps someone more versed in JSON schemas can chime in, but it seems you'll have to go back to the source system and get it fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 15:42:14 GMT</pubDate>
    <dc:creator>edhans</dc:creator>
    <dc:date>2021-03-15T15:42:14Z</dc:date>
    <item>
      <title>JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'.</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1722979#M52256</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to call an API via a custom function in PowerBI. It works well for most of the API calls in the report, however I am encountering issue with the final table I need to create.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am calling an API from our monitoring system PRTG, this is called twice prior, to get the "Device ID's" and the "Sensor ID's" - the Sensor ID table is where I invoke the custom function which I've included below, filling the ID parameter with the ID column in Sensor ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(id as text, sdate as text, edate as text) =&amp;gt;

let
    Source   = Json.Document(Web.Contents("https://PRTGSERVERNAME.REDACTED.com/",[RelativePath="api/historicdata.json?id=&amp;amp;avg=84600&amp;amp;sdate=&amp;amp;edate=&amp;amp;username=&amp;amp;passhash=",Query=[id=id,sdate=sdate,edate=edate,username="REDACTED",passhash="REDACTED"]])),
sensors = Source[sensors]
 in 
    Source&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When this runs, all of the cells created by the function are "Error", with the error code &lt;EM&gt;"An error occurred in the ‘’ query. DataFormat.Error: Duplicate name 'value'."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've run the API call in postman, and think I understand the problem, just not how to solve it - the JSON that is returned (see below) has multiple columns named "value"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some way I can rename all of the columns (or some of them at least) so that the query passes, and I can then transform them further from there? I cannot expand them as a result of the error resulting from the column names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "prtg-version": "20.3.60.1623",
    "treesize": 28,
    "histdata": [
        {
            "datetime": "1/31/2021 11:30:00 PM - 11:00:00 PM",
            "datetime_raw": 44228.9583333333,
            "value": "20 msec",
            "value_raw": 20.4038,
            "value": "16 msec",
            "value_raw": 16.1791,
            "value": "28 msec",
            "value_raw": 27.8521,
            "value": "&amp;lt;1 %",
            "value_raw": 0.0363,
            "value": "0 %",
            "value_raw": 0.0000,
            "coverage": "100 %",
            "coverage_raw": 10000
        },
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:50:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1722979#M52256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T15:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'.</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1722991#M52257</link>
      <description>&lt;P&gt;I don't see a way to do this. It seems the format is not valid JSON. Even when I manually remove the duplicate names, the next error is this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;So at best that file seems to be "json-ish" but not a true JSON file. Perhaps someone more versed in JSON schemas can chime in, but it seems you'll have to go back to the source system and get it fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:42:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1722991#M52257</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-03-15T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'.</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1723014#M52260</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24715" data-lia-user-login="edhans" class="lia-mention lia-mention-user"&gt;edhans&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for a quick response, much appreciated.&lt;BR /&gt;&lt;BR /&gt;I should have thought to troubleshoot by adding it as a json file - my bad! I think the JSON snippet I sent originally was missing the second square bracket - I've added that in now to my original post!&lt;BR /&gt;&lt;BR /&gt;If I remove the duplicate column names it works for me (now that I've included the closing ] ). Is there any way I can address the column problem in Power Query by forcing it to rename or anything along those lines?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:56:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1723014#M52260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T15:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'.</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1723220#M52262</link>
      <description>&lt;P&gt;The issue&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;is with a JSON, all of this section comes in as one record, and each field has a name:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;So in Power Query it looks like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power Query cannot even open it to parse it into a record with the duplicate Value/Value_Raw fields. So I don't think your JSON is following standards. Those either need to be renamed in the JSON, or created as separate records within the main record.&amp;nbsp;&lt;A href="https://www.w3resource.com/JSON/structures.php" target="_blank"&gt;JSON Structures | JSON tutorial | w3resource&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 17:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/1723220#M52262</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-03-15T17:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Record with Duplicate Column Names: DataFormat.Error: Duplicate name 'value'.</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/3066650#M97468</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello, did you solve this?&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I am in the exact same situation and It's painful.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 16:08:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/JSON-Record-with-Duplicate-Column-Names-DataFormat-Error/m-p/3066650#M97468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-07T16:08:13Z</dc:date>
    </item>
  </channel>
</rss>

