<?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: For each month within a timespan create a new entry in an new table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2763152#M85711</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What is your meaning? Could you please provide a simple like the above? Or some screenshots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 05:10:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-13T05:10:09Z</dc:date>
    <item>
      <title>For each month within a timespan create a new entry in an new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2760489#M85535</link>
      <description>&lt;P&gt;Hi. I defently need some help, after searching some hours for a solution by myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if I start with this table which could be the startdate and enddate of an contract:&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;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;start&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;end&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1/1/2020&lt;/TD&gt;&lt;TD&gt;3/31/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2/1/2020&lt;/TD&gt;&lt;TD&gt;4/30/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a table, which tells me for each month that the contract is still running.&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;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;time_point&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this table , I would be able to make a view how many contracts are running each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everybody!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 19:29:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2760489#M85535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-11T19:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: For each month within a timespan create a new entry in an new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2760767#M85562</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have create a simple sample , please refer to it to see if it helps you.&lt;/P&gt;
&lt;P&gt;Add a custom column in Power Query.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;List.Dates(DateTime.Date([start]),Duration.Days(DateTime.Date([end]) -DateTime.Date([start])), #duration(1,0,0,0))&lt;/LI-CODE&gt;
&lt;P&gt;Then expand the custom column.&lt;/P&gt;
&lt;P&gt;Finally create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _year =
    YEAR ( MAX ( 'Table'[Custom] ) )
VAR _month =
    MONTH ( MAX ( 'Table'[Custom] ) )
RETURN
    IF (
        MAX ( 'Table'[Custom] ) = DATE ( _year, _month, 1 ),
        MAX ( 'Table'[Custom] ),
        BLANK ()
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 02:48:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2760767#M85562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-12T02:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: For each month within a timespan create a new entry in an new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2761600#M85621</link>
      <description>&lt;P&gt;Great Polly, this works very well so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, by this way a recieve a table with millons of entries in the first step, because each day is an entry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the second step, we eliminate those millions by filtering only the month's first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an alternative way to filter them in the first place before creating a table. This way consumes a lot space and calucation time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:38:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2761600#M85621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-12T10:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: For each month within a timespan create a new entry in an new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2763152#M85711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What is your meaning? Could you please provide a simple like the above? Or some screenshots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 05:10:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2763152#M85711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T05:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: For each month within a timespan create a new entry in an new table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2763462#M85721</link>
      <description>&lt;P&gt;Hi, thanks for staying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I finnaly found a solution by myself. I did is this way. I&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was the starting point&lt;/P&gt;&lt;P&gt;= Table.AddColumn(ET_Contract_Generation_Asset__c, "Duration_Days", each List.Dates(DateTime.Date([Start_Date__c]),Duration.Days(DateTime.Date([End_Date__c]) -DateTime.Date([Start_Date__c])), #duration(1,0,0,0)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transform all dates to the first&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Table.AddColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Duration_Days_First_Of_Month", each List.Transform([Duration_Days],each Date.StartOfMonth(_)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delete Duplicates&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Table.AddColumn(#"Hinzugefügte benutzerdefinierte Spalte1", "Duration_Months", each List.Distinct([Duration_Days_First_Of_Month]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way the memory and calucation isn't collapsing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 07:18:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-month-within-a-timespan-create-a-new-entry-in-an-new/m-p/2763462#M85721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T07:18:49Z</dc:date>
    </item>
  </channel>
</rss>

