<?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: How to read JSON when first data is name of columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2536201#M71277</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="388445" data-lia-user-login="Nick_2510" class="lia-mention lia-mention-user"&gt;Nick_2510&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are some null values in the dataset, it will generate an error when trying to parse. You can try to replace the empty value with the empty structure "&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;", then it will parse and return the empty value correctly&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Power-Query/Expression-Error-The-parameter-is-expected-to-be-of-type-Text/td-p/1123176" target="_blank"&gt;https://community.powerbi.com/t5/Power-Query/Expression-Error-The-parameter-is-expected-to-be-of-type-Text/td-p/1123176&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 12:37:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-24T12:37:01Z</dc:date>
    <item>
      <title>How to read JSON when first data is name of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2529626#M70883</link>
      <description>&lt;P&gt;how to read JSON in&amp;nbsp; power bi when first data is name of columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "fields":&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;["name_table1", "name_table2", "name_table3"],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "data": [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;["d1","d1","d1"],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;["d2", "d2", "d2"]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 13:58:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2529626#M70883</guid>
      <dc:creator>Nick_2510</dc:creator>
      <dc:date>2022-05-20T13:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to read JSON when first data is name of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2531499#M71022</link>
      <description>&lt;P&gt;Thank you for the nice challenge. Here is one possible approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = "{    ""fields"":
             [""name_table1"", ""name_table2"", ""name_table3""],
                          ""data"": [
                                       [""d1"",""d1"",""d1""],
                                       [""d2"", ""d2"", ""d2""]
                                       ]
}",
    #"Parsed JSON" = Json.Document(Source),
    data = #"Parsed JSON"[data],
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Extracted Values" = Table.TransformColumns(#"Converted to Table", {"Column1", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Column1", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}, {"Column1.2", type text}, {"Column1.3", type text}}),
    Ren = List.Zip({Table.ColumnNames(#"Changed Type"),#"Parsed JSON"[fields]}),
    Res = Table.RenameColumns(#"Changed Type",Ren)
in
    Res&lt;/LI-CODE&gt;
&lt;P&gt;How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2022 19:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2531499#M71022</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-05-22T19:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to read JSON when first data is name of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2532211#M71055</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I got an&amp;nbsp;Expression.Error, it must be Text.Type or Binary.Type. But&amp;nbsp;fields=[List],&amp;nbsp;data=[List]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;real example -&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1OzleprjuacRzFp0cMBlxFESE6ipIJx50/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1OzleprjuacRzFp0cMBlxFESE6ipIJx50/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Json.Document(File.Contents("C:\Users\voenik\Desktop\ex.json")),&lt;BR /&gt;#"Parsed JSON" = Json.Document(Source),&lt;BR /&gt;data = #"Parsed JSON"[data],&lt;BR /&gt;#"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Extracted Values" = Table.TransformColumns(#"Converted to Table", {"Column1", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),&lt;BR /&gt;#"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Column1", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3"}),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}, {"Column1.2", type text}, {"Column1.3", type text}}),&lt;BR /&gt;Ren = List.Zip({Table.ColumnNames(#"Changed Type"),#"Parsed JSON"[fields]}),&lt;BR /&gt;Res = Table.RenameColumns(#"Changed Type",Ren)&lt;BR /&gt;in&lt;BR /&gt;Res&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 06:47:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2532211#M71055</guid>
      <dc:creator>Nick_2510</dc:creator>
      <dc:date>2022-05-23T06:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to read JSON when first data is name of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2536201#M71277</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="388445" data-lia-user-login="Nick_2510" class="lia-mention lia-mention-user"&gt;Nick_2510&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are some null values in the dataset, it will generate an error when trying to parse. You can try to replace the empty value with the empty structure "&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;", then it will parse and return the empty value correctly&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/The-parameter-is-expected-to-be-of-type-Text-Type-or-Binary-Type/m-p/49345&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Power-Query/Expression-Error-The-parameter-is-expected-to-be-of-type-Text/td-p/1123176" target="_blank"&gt;https://community.powerbi.com/t5/Power-Query/Expression-Error-The-parameter-is-expected-to-be-of-type-Text/td-p/1123176&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 12:37:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-read-JSON-when-first-data-is-name-of-columns/m-p/2536201#M71277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-24T12:37:01Z</dc:date>
    </item>
  </channel>
</rss>

