<?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: Combining multiple result sets from JSON in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Combining-multiple-result-sets-from-JSON/m-p/1937647#M30335</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/252840"&gt;@SysLostInBI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that your json code will return many lists. Firsly, get data in Power BI Desktop by Json connector to connect to the Json File or web to connect to the API to get Json File. Then you need to transform the json file to Power BI Table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/Converting-JSON-data-into-PowerBI-table/m-p/256455" target="_self"&gt;&lt;SPAN&gt;Converting JSON data into PowerBI table&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/" target="_self"&gt;Using Power BI with JSON Data Sources and Files&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When you connect to Json, you need to transform your table to the result as below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 698px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/546433i90E88863C78B162F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here I get data from Json to have a test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Json.Document(File.Contents("......")),
    result = Source[result],
    result1 = result{0},
    #"Converted to Table" = Record.ToTable(result1),
#"Extracted Values" = Table.TransformColumns(#"Converted to Table", {"Value", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Value", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Value.1", "Value.2", "Value.3", "Value.4", "Value.5"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Value.1", type text}, {"Value.2", type number}, {"Value.3", type number}, {"Value.4", type number}, {"Value.5", type number}}),
#"Transposed Table" = Table.Transpose(#"Changed Type"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"dimensions", type text}, {"timestamps", Int64.Type}, {"action-per-session", type number}, {"actionCount", type number}}),
#"Filled Down" = Table.FillDown(#"Changed Type1",{"dimensions"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Filled Down",{{"timestamps", type text}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type2", {{"action-per-session", type text}, {"actionCount", type text}}, "en-US"),{"dimensions", "timestamps", "action-per-session", "actionCount"},Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"Merged")
in
#"Merged Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally Select all rows , right click and use merge function in Power Query.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/546438i8388D31B5CD84941/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 09:07:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-05T09:07:38Z</dc:date>
    <item>
      <title>Combining multiple result sets from JSON</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combining-multiple-result-sets-from-JSON/m-p/1935164#M30303</link>
      <description>&lt;P&gt;Can someone help me to understand how I have to process this json result from my IP.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  "result": [
    {
      "metricId": "actionsPerSession",
      "data": [
        {
          "dimensions": [
            "APPLICATION-A"
          ],
          "dimensionMap": {
            "dt.entity.application": "APPLICATION-A"
          },
          "timestamps": [
            1614556800000,
            1617235200000,
            1619827200000,
            1622505600000,
            1625097600000
          ],
          "values": [
            21.28073384020771,
            47.06336163296851,
            11.023587012711282,
            10.320278490922409,
            10.740145332074341
          ]
        }
      ]
    },
    {
      "metricId": "actionCount",
      "data": [
        {
          "dimensions": [
            "APPLICATION-A"
          ],
          "dimensionMap": {
            "dt.entity.application": "APPLICATION-A"
          },
          "timestamps": [
            1614556800000,
            1617235200000,
            1619827200000,
            1622505600000,
            1625097600000
          ],
          "values": [
            6707,
            28477.333333333332,
            144980,
            859878.6666666666,
            798342.6666666666
          ]
        }
      ]
    }
  ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end-result should look something like:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;application | timestamp | action-per-session | actionCount |&lt;/STRONG&gt;&lt;BR /&gt;APPLICATION-A | 1614556800000 | 21.28073384020771 |6707|&lt;BR /&gt;APPLICATION-A | 1617235200000 | 47.06336163296851 |28477.333333333332|&lt;BR /&gt;Any help is much appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 10:30:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combining-multiple-result-sets-from-JSON/m-p/1935164#M30303</guid>
      <dc:creator>SysLostInBI</dc:creator>
      <dc:date>2021-07-02T10:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Combining multiple result sets from JSON</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Combining-multiple-result-sets-from-JSON/m-p/1937647#M30335</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/252840"&gt;@SysLostInBI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that your json code will return many lists. Firsly, get data in Power BI Desktop by Json connector to connect to the Json File or web to connect to the API to get Json File. Then you need to transform the json file to Power BI Table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/Converting-JSON-data-into-PowerBI-table/m-p/256455" target="_self"&gt;&lt;SPAN&gt;Converting JSON data into PowerBI table&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/" target="_self"&gt;Using Power BI with JSON Data Sources and Files&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When you connect to Json, you need to transform your table to the result as below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 698px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/546433i90E88863C78B162F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here I get data from Json to have a test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Json.Document(File.Contents("......")),
    result = Source[result],
    result1 = result{0},
    #"Converted to Table" = Record.ToTable(result1),
#"Extracted Values" = Table.TransformColumns(#"Converted to Table", {"Value", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Value", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Value.1", "Value.2", "Value.3", "Value.4", "Value.5"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Value.1", type text}, {"Value.2", type number}, {"Value.3", type number}, {"Value.4", type number}, {"Value.5", type number}}),
#"Transposed Table" = Table.Transpose(#"Changed Type"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"dimensions", type text}, {"timestamps", Int64.Type}, {"action-per-session", type number}, {"actionCount", type number}}),
#"Filled Down" = Table.FillDown(#"Changed Type1",{"dimensions"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Filled Down",{{"timestamps", type text}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type2", {{"action-per-session", type text}, {"actionCount", type text}}, "en-US"),{"dimensions", "timestamps", "action-per-session", "actionCount"},Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"Merged")
in
#"Merged Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally Select all rows , right click and use merge function in Power Query.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/546438i8388D31B5CD84941/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 09:07:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Combining-multiple-result-sets-from-JSON/m-p/1937647#M30335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-05T09:07:38Z</dc:date>
    </item>
  </channel>
</rss>

