<?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: 30 days lock calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086158#M162178</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="786741" data-lia-user-login="fabric_ba" class="lia-mention lia-mention-user"&gt;fabric_ba&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;There are 3 updates for C3 in the month of Feb&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But your expected output shows the count as 1.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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;</description>
    <pubDate>Wed, 07 Aug 2024 07:32:57 GMT</pubDate>
    <dc:creator>SachinNandanwar</dc:creator>
    <dc:date>2024-08-07T07:32:57Z</dc:date>
    <item>
      <title>30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085858#M162163</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have two tables, 'Input' and 'Date', with the following relationships: -&lt;/P&gt;&lt;P&gt;- An **active** relationship between ‘Date’[Date] and Input[Start date].&lt;/P&gt;&lt;P&gt;- An **inactive** relationship between ‘Date’[Date] and Input[Updated on].&lt;/P&gt;&lt;P&gt;### Context: - **'Start date'**: The date when a demand is made.&lt;/P&gt;&lt;P&gt;**'Updated on'**: The date when the data is released.&lt;/P&gt;&lt;P&gt;&amp;nbsp;### Matrix Visual Setup: -&lt;/P&gt;&lt;P&gt;**Rows**: 'Category data' from the 'Input' table.&lt;/P&gt;&lt;P&gt;**Columns**: 'Month_Year' from the 'Date' table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to implement a "30-day lock" period, which means for each selected month, I want to sum the 'Overall Pending' values based on the 'Updated on' dates from the previous month. For example:&lt;/P&gt;&lt;P&gt;- If the matrix column is July-24, the measure should sum the 'Overall Pending' where `by referring the data released on `Input[Updated on]`June and give the result for `Input[Start date]` July.&lt;/P&gt;&lt;P&gt;- Similarly, for June-24, it should consider May-24 data, and so on.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I have attached an image with the input file and the expected result. I’m attaching the pbi file.&lt;A href="https://drive.google.com/file/d/1UxCT8qZsOo7GULbcMSLK_7MrTLO2jXJL/view?usp=drivesdk" target="_self"&gt;30 day lock file&lt;/A&gt;&amp;nbsp;&amp;lt;- pbi file updated&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 06:11:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085858#M162163</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T06:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085875#M162165</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;The pbi file is no longer available&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 05:54:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085875#M162165</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-07T05:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085916#M162168</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I have updated the link.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 06:12:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4085916#M162168</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T06:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086158#M162178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="786741" data-lia-user-login="fabric_ba" class="lia-mention lia-mention-user"&gt;fabric_ba&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;There are 3 updates for C3 in the month of Feb&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But your expected output shows the count as 1.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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;</description>
      <pubDate>Wed, 07 Aug 2024 07:32:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086158#M162178</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-07T07:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086179#M162180</link>
      <description>&lt;P&gt;Yes &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;, The numbers are based on start date. For the Feb 24 we need to look at Updated on Jan 24 in that we have only one start date for Feb 24.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 07:37:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086179#M162180</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T07:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086440#M162194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="786741" data-lia-user-login="fabric_ba" class="lia-mention lia-mention-user"&gt;fabric_ba&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you want to classify the C1, C2, and C3 of the corresponding previous month of the previous year according to the month of 2024, and put the result Total into a matrix?&lt;/P&gt;
&lt;P&gt;If so,I did a test for your reference.&lt;/P&gt;
&lt;P&gt;In my scenario:&lt;/P&gt;
&lt;P&gt;My Model View:&lt;/P&gt;
&lt;P&gt;I created a new table and sorted it in ascending order based on the month in the table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = ADDCOLUMNS( CALENDAR(DATE(2024,1,1), DATE(2024,12,31)) , "Month Year" , FORMAT([Date],"MMM yyyy") ,"Month" , MONTH([Date]) )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The months in the table are sorted in ascending order:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;My Report View:&lt;/P&gt;
&lt;P&gt;I created two measures, one to determine whether the month +1 in the 'Input' table is greater than the month in the 'Table' table, and if so, the statistics are displayed in the matrix, and one to show the C1, C2, and C3 values of statistics:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = MONTH( CALCULATE( MAX('Input'[Updated_on]), ALL('Input'))  ) +1&amp;gt;= MAX('Table'[Month])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = IF(MONTH( CALCULATE( MAX('Input'[Updated_on]), ALL('Input'))  ) +1&amp;gt;= MAX('Table'[Month]), CALCULATE( SUM('Input'[Overall Pending]) ,YEAR('Input'[Updated_on]) =   YEAR( MAX('Table'[Date]) ) -1 &amp;amp;&amp;amp; MONTH('Input'[Updated_on])+1 =   MONTH( MAX('Table'[Date]) )  )+0 )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Sunshine Gu&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:05:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086440#M162194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-07T10:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086468#M162195</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; for your solution.&lt;/P&gt;&lt;P&gt;Let me explain the use case. This data pertains to Human Resources. Every month, a file is released containing actuals and forecasts of employee demand and its appended. The "Updated on" column indicates the release date of the file, while the "Start date" represents the date of the demand.&lt;/P&gt;&lt;P&gt;For the 30-day lock, I'm trying to compare the predicted demand for a given month with the corresponding predictions in the previously released file.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 09:44:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086468#M162195</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T09:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086492#M162196</link>
      <description>&lt;P&gt;There are 2 duplicate entries for C1 for the update month of April.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Should they be counted as two seperate entries ? If yes then there has to be an unique identifier .&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 09:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086492#M162196</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-07T09:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086502#M162197</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;We can have mulitple entries, Updated on is the date when file/data is released.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:08:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086502#M162197</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T10:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086504#M162198</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;There are 2 entries with the same UpdateDate and StartDate.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:10:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086504#M162198</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-07T10:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086524#M162200</link>
      <description>&lt;P&gt;We can have a duplicate&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 10:22:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086524#M162200</guid>
      <dc:creator>fabric_ba</dc:creator>
      <dc:date>2024-08-07T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: 30 days lock calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086571#M162202</link>
      <description>&lt;P&gt;If you want the duplicate records to be counted as one value then use a this measure formula&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure_CountRows = 
 Var _Cal=CALCULATE(Countrows(FILTER (
    ADDCOLUMNS (
        SUMMARIZE (
            ( Input ),
            Input[Category],
            'Date'[Month],
            'Date'[Year],
            Input[Updated_on]
        ),
        "StartDateMonthNo", 'Date'[Month],
        "Cnt",
            CALCULATE (
                COUNT ( Input[Category] ),
                USERELATIONSHIP ( 'Date'[Date], Input[Start Date] )
            )
    ),
    FORMAT ( Input[Updated_on], "MM" ) + 1 = 'Date'[Month]
)))

RETURN _Cal&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Else use this to create a summarized table&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table = FILTER (
    ADDCOLUMNS (
        SUMMARIZE (
            ( Input ),
            Input[Category],
            'Date'[Month],
            'Date'[Year],
            Input[Updated_on]
        ),
        "StartDateMonthNo", 'Date'[Month],
        "Cnt",
            CALCULATE (
                COUNT ( Input[Category] ),
                USERELATIONSHIP ( 'Date'[Date], Input[Start Date] )
            )
    ),
    FORMAT ( Input[Updated_on], "MM" ) + 1 = 'Date'[Month]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Wed, 07 Aug 2024 10:48:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/30-days-lock-calculation/m-p/4086571#M162202</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-07T10:48:21Z</dc:date>
    </item>
  </channel>
</rss>

