<?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: DAX command to duplicate rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389565#M62076</link>
    <description>&lt;P&gt;Thank you. This formula does work .&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 23:03:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-11T23:03:39Z</dc:date>
    <item>
      <title>DAX command to duplicate rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389494#M62072</link>
      <description>&lt;P&gt;Hello,&amp;nbsp; I am trying to find a way to duplicate rows in the fact table using DAX (Not via power Query) in a calculated column . I need rows which have count column &amp;gt; 1 to be duplicated by the number of times the count represents.&amp;nbsp; Image below. Would appreciate any gudiance here&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 21:35:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389494#M62072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-11T21:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command to duplicate rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389533#M62074</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Out of interest, what's the context for creating this duplicated table, and how would it be used?&lt;/P&gt;
&lt;P&gt;Also, I wasn't sure what you meant by "in a calculated column".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, you could create a table with duplicated rows, referencing the original 'Fact' with an expression like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Fact Duplicated = 
GENERATE (
    'Fact',
    SELECTCOLUMNS (
        GENERATESERIES ( 1, 'Fact'[Count] ),
        "Index", [Value]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The resulting table will have an additional Index column, with values 1..Count for each original row.&lt;/P&gt;
&lt;P&gt;You could use SELECTCOLUMNS to retain just the required columns if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 22:22:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389533#M62074</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-03-11T22:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command to duplicate rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389540#M62075</link>
      <description>&lt;P&gt;Thank you Owen. I will try your solution out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The test data that I have listed is just for simplicty ; The actual use case is that we have an initiatives around sales that drive revenue. Each row in the fact table represents a sale . Sometimes one of these rows can be driven by two or more initiatives ( count &amp;gt; 1 represents the nunber of initiatves that drove the sale). We need to attribute certain % of revenue to each initiative. Duplicating the rows would enable me to use %`s to attribute revenue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S I gave Count as number for simplicty. actual data has count as text values&amp;nbsp; segregated by delimiter for eg DigitalMarketing/SalesDriven/EmailCampaign.&amp;nbsp; Duplicating the rows &amp;amp; little bit of dax will enable me to split one row and then each row will have one initiative &amp;amp; associated % . This will help me use it in reporting/filters etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially i thought aboout calcuated table , but was not sure about it because now I will have to connect all the dimesnion table to teh new calcuated table again. The original table has values beign pulled in from teh Dim tables using Related&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 22:34:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389540#M62075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-11T22:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command to duplicate rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389565#M62076</link>
      <description>&lt;P&gt;Thank you. This formula does work .&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 23:03:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389565#M62076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-11T23:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX command to duplicate rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389867#M62104</link>
      <description>&lt;P&gt;Thanks for the further explanation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend that this sort of splitting/allocation is done before the table arrives in the data model, either in data source or Power Query. It's unusual to use DAX for this sort of operation, and as you've mentioned, you end up having to re-create all relationships with the new table, as well as having a possibly redundant table left in the model.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 13:25:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-command-to-duplicate-rows/m-p/2389867#M62104</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-03-12T13:25:45Z</dc:date>
    </item>
  </channel>
</rss>

