<?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: create new rows for each number of students identified in the cell 'Number of new students' in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-new-rows-for-each-number-of-students-identified-in-the/m-p/1467537#M27793</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be done easily and best in Power Query. Place the following M code in a blank query to see the steps. Could be done in DAX as well if required&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlLSUTIyMDQDUoZAHJmaWKQAYrgCsTkQB6UmpmTmpSsk5qUolGWmlgPZSrE60UomEH0gJUYwfSCGI8ggA1M8Os0hOi2AlDFMJ4jhDNJpboBHpylEpyWQMoHpBDGcgNjUApfGWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"School ID" = _t, Year = _t, Semester = _t, #"Year Level" = _t, #"Assessment Results" = _t, #"Number of students" = _t, #"Assessment Criteria Name" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"School ID", Int64.Type}, {"Year", Int64.Type}, {"Semester", Int64.Type}, {"Year Level", type text}, {"Assessment Results", type text}, {"Number of students", Int64.Type}, {"Assessment Criteria Name", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Numbers(1,[Number of students])),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Custom"})
in
    #"Removed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Nov 2020 08:02:21 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-11-01T08:02:21Z</dc:date>
    <item>
      <title>create new rows for each number of students identified in the cell 'Number of new students'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-new-rows-for-each-number-of-students-identified-in-the/m-p/1467518#M27791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have schood data that summarises the column named 'Number of Students' as number values - See below table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;School ID&lt;/TD&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;Semester&lt;/TD&gt;&lt;TD&gt;Year Level&lt;/TD&gt;&lt;TD&gt;Assessment Results&lt;/TD&gt;&lt;TD&gt;Number of students&lt;/TD&gt;&lt;TD&gt;Assessment Criteria Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Year 1&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Reading and viewing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Year 2&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;105&lt;/TD&gt;&lt;TD&gt;Reading and viewing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Year 3&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;170&lt;/TD&gt;&lt;TD&gt;Reading and viewing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Year 4&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;58&lt;/TD&gt;&lt;TD&gt;Reading and viewing&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create new rows for each number of students identified in the cell 'Number of new students'.&lt;/P&gt;&lt;P&gt;Example: If 'Number of new students' cell is '58' then create '58' new row instances of that cell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to result in a single row for 1 student. Hence... 1 row represents 1 student.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Theo.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 04:46:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-new-rows-for-each-number-of-students-identified-in-the/m-p/1467518#M27791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-01T04:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: create new rows for each number of students identified in the cell 'Number of new students'</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-new-rows-for-each-number-of-students-identified-in-the/m-p/1467537#M27793</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be done easily and best in Power Query. Place the following M code in a blank query to see the steps. Could be done in DAX as well if required&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlLSUTIyMDQDUoZAHJmaWKQAYrgCsTkQB6UmpmTmpSsk5qUolGWmlgPZSrE60UomEH0gJUYwfSCGI8ggA1M8Os0hOi2AlDFMJ4jhDNJpboBHpylEpyWQMoHpBDGcgNjUApfGWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"School ID" = _t, Year = _t, Semester = _t, #"Year Level" = _t, #"Assessment Results" = _t, #"Number of students" = _t, #"Assessment Criteria Name" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"School ID", Int64.Type}, {"Year", Int64.Type}, {"Semester", Int64.Type}, {"Year Level", type text}, {"Assessment Results", type text}, {"Number of students", Int64.Type}, {"Assessment Criteria Name", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Numbers(1,[Number of students])),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Custom"})
in
    #"Removed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 08:02:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-new-rows-for-each-number-of-students-identified-in-the/m-p/1467537#M27793</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-01T08:02:21Z</dc:date>
    </item>
  </channel>
</rss>

