<?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: Frequency Calender in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687029#M80744</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323518" data-lia-user-login="crsjunior" class="lia-mention lia-mention-user"&gt;crsjunior&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You need to generate the dates in a (temp) table.&lt;/P&gt;&lt;P&gt;You can use generate()&amp;nbsp;&amp;nbsp;&lt;A href="https://dax.guide/generate/" target="_blank"&gt;GENERATE – DAX Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 10:15:08 GMT</pubDate>
    <dc:creator>latimeria</dc:creator>
    <dc:date>2022-08-08T10:15:08Z</dc:date>
    <item>
      <title>Frequency Calender</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2686889#M80734</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my database there's a column with the inicial date and a number column with the frequency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is to create a visual showing when that data will apear in the next 60 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: initial date: 01/08/2022, with frequency 7, it has to apear in the dates (08/08/2022; 15/08/2022; 22/08/2022......26/08/2022)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below, image of what I need to replicate in Power BI.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't think on a solution with DAX.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 09:31:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2686889#M80734</guid>
      <dc:creator>crsjunior</dc:creator>
      <dc:date>2022-08-08T09:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency Calender</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687029#M80744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323518" data-lia-user-login="crsjunior" class="lia-mention lia-mention-user"&gt;crsjunior&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You need to generate the dates in a (temp) table.&lt;/P&gt;&lt;P&gt;You can use generate()&amp;nbsp;&amp;nbsp;&lt;A href="https://dax.guide/generate/" target="_blank"&gt;GENERATE – DAX Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 10:15:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687029#M80744</guid>
      <dc:creator>latimeria</dc:creator>
      <dc:date>2022-08-08T10:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency Calender</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687040#M80745</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323518" data-lia-user-login="crsjunior" class="lia-mention lia-mention-user"&gt;crsjunior&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a solution that uses the GENERATE function to evaluate each day against each 'line item' to see if the combination of initial date and frequency is a match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what the test data looked like&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="99.87654320987654%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Line Item&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;Initial Date&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;Frequency&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Item 1&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;01/08/2022&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Item 2&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;07/08/2022&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Item 3&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;06/08/2022&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Item 4&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;16/08/2022&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="27.40740740740741%"&gt;Item 5&lt;/TD&gt;
&lt;TD width="34.074074074074076%"&gt;13/08/2022&lt;/TD&gt;
&lt;TD width="38.39506172839506%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plus I have a Date table in the model&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the measure to check if a line item occurs on a date.&amp;nbsp; (to be more specific it counts the number of occurrences for all line items and dates in the filter context, giving you totals per line item and per date that make sense / may be useful)&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Occurs on this date = 
VAR _Occurs = 
CALCULATETABLE(
    GENERATE(
        'Date',
        FILTER('Line Items', 
            MOD('Line Items'[Initial Date] - 'Date'[Date], 'Line Items'[Frequency]) = 0
                &amp;amp;&amp;amp; 'Date'[Date] &amp;gt;= 'Line Items'[Initial Date]
            )
        ),
    CROSSFILTER('Date'[Date],'Line Items'[Initial Date], None)
)
VAR _Result = COUNTROWS(_Occurs)
RETURN
    _Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a matrix visual that looks like this - notice the total row is giving number of occurances for all line items on that day&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.. with background color and font color set to On&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 10:22:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687040#M80745</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2022-08-08T10:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency Calender</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687276#M80773</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150936" data-lia-user-login="PaulOlding" class="lia-mention lia-mention-user"&gt;PaulOlding&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked perfectly with my dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 12:10:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Frequency-Calender/m-p/2687276#M80773</guid>
      <dc:creator>crsjunior</dc:creator>
      <dc:date>2022-08-08T12:10:54Z</dc:date>
    </item>
  </channel>
</rss>

