<?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: Calculated column of previous value by date &amp;amp; customer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388086#M61978</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Previous Date =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer Code] ) )
VAR T2 =
    FILTER ( 'T1', [Date] &amp;lt; CurrentDate )
VAR T3 =
    TOPN ( 1, 'T2', [Date] )
VAR Result =
    SELECTCOLUMNS ( 'T3', "@Date", [Date] )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 08:20:36 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-03-11T08:20:36Z</dc:date>
    <item>
      <title>Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386446#M61847</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hi guys,&lt;BR /&gt;i wish to add a calculated column as in E column above which calculates the previous grade (by date and customer). please note that in my table i have rows which do not hold a grade and presenting blank value.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386446#M61847</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-10T14:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386741#M61867</link>
      <description>&lt;PRE&gt;Prev grade = &lt;BR /&gt;var currentDate = 'Grades'[Date]&lt;BR /&gt;return SELECTCOLUMNS( CALCULATETABLE( &lt;BR /&gt;TOPN( 1, 'Grades', 'Grades'[Date]), ALLEXCEPT(Grades,Grades[Customer code]),&lt;BR /&gt;'Grades'[Date] &amp;lt; currentDate ), &lt;BR /&gt;"@prev grade", 'Grades'[Grade] )&lt;/PRE&gt;&lt;P&gt;Create this as a new column&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 15:39:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386741#M61867</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-03-10T15:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386892#M61883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="191221" data-lia-user-login="akfir" class="lia-mention lia-mention-user"&gt;akfir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Previous Grade =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE (
        'Table',
        ALLEXCEPT ( 'Table', 'Table'[Customer Code] ),
        'Table'[Date] &amp;lt; CurrentDate
    )
VAR T2 =
    TOPN ( 1, 'T1', [Date] )
VAR T3 =
    SELECTCOLUMNS ( 'T2', "@PGrade", [Grade] )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386892#M61883</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T16:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386931#M61888</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="191221" data-lia-user-login="akfir" class="lia-mention lia-mention-user"&gt;akfir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may also try this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Previous Grade =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer Code] ) )
VAR T2 =
    ADDCOLUMNS ( 'T1', "@Ranking", RANKX ( 'T1', [Date] ) )
VAR T3 =
    ADDCOLUMNS (
        'T2',
        "@PGrade",
            VAR CurrentRank = [@Ranking]
            RETURN
                LOOKUPVALUE ( [Grade], [@Ranking], CurrentRank + 1 )
    )
VAR T4 =
    FILTER ( 'T3', [Date] = CurrentDate )
VAR Result =
    SUMX ( 'T4', [@PGrade] )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 17:07:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2386931#M61888</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T17:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387255#M61915</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:09:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387255#M61915</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-10T21:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387262#M61917</link>
      <description>&lt;P&gt;there is no RESULT variable to return....&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:13:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387262#M61917</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-10T21:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387269#M61918</link>
      <description>&lt;LI-CODE lang="javascript"&gt;Previous Grade =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE (
        'Table',
        ALLEXCEPT ( 'Table', 'Table'[Customer Code] ),
        'Table'[Date] &amp;lt; CurrentDate
    )
VAR T2 =
    TOPN ( 1, 'T1', [Date] )
VAR Result =
    SELECTCOLUMNS ( 'T2', "@PGrade", [Grade] )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:19:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387269#M61918</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T21:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387299#M61920</link>
      <description>&lt;P&gt;&amp;lt;pi&amp;gt;there's not enough memory to complete this operation. please try again later when there may be more memory available.&amp;lt;/pi&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387299#M61920</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-10T21:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387318#M61921</link>
      <description>&lt;P&gt;How big is your table?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387318#M61921</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T21:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387327#M61922</link>
      <description>&lt;P&gt;30K rows&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 21:54:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387327#M61922</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-10T21:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387386#M61926</link>
      <description>&lt;P&gt;How many columns?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 22:22:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387386#M61926</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T22:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387396#M61928</link>
      <description>&lt;P&gt;We may reduce the number of columns if you have too many. For now please try this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Previous Grade =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer Code] ) )
VAR T2 =
    FILTER ( 'T1', [Date] &amp;lt; CurrentDate )
VAR T3 =
    TOPN ( 1, 'T2', [Date] )
VAR T4 =
    SELECTCOLUMNS ( 'T3', "@PGrade", [Grade] )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 22:30:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387396#M61928</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-10T22:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387912#M61962</link>
      <description>&lt;P&gt;Perfect thanks! now i wish to add a column of the date referring to this previous value - in my example above - for the first row i want the value to be 01/02/2022&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 07:00:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2387912#M61962</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-11T07:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388086#M61978</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Previous Date =
VAR CurrentDate = 'Table'[Date]
VAR T1 =
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Customer Code] ) )
VAR T2 =
    FILTER ( 'T1', [Date] &amp;lt; CurrentDate )
VAR T3 =
    TOPN ( 1, 'T2', [Date] )
VAR Result =
    SELECTCOLUMNS ( 'T3', "@Date", [Date] )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 08:20:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388086#M61978</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-11T08:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388208#M61990</link>
      <description>&lt;P&gt;Awsome!! thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 09:07:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388208#M61990</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-11T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388238#M61992</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="191221" data-lia-user-login="akfir" class="lia-mention lia-mention-user"&gt;akfir&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;If my reply solved your problem please consider marking it as an acceptable solution. Thank you and have a great day!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 09:14:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2388238#M61992</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-11T09:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390557#M62151</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Why is that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:36:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390557#M62151</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-13T14:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390569#M62152</link>
      <description>&lt;P&gt;this is something related to T4, because the previous date column that you helped me as well - still valid and not showing any error.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:51:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390569#M62152</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-13T14:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390574#M62153</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="191221" data-lia-user-login="akfir" class="lia-mention lia-mention-user"&gt;akfir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That means you have multiple records in the same date. Then you can only aggregate by sum or max/min or otherwise provide more filters that can restrict the result to only one record.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:56:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390574#M62153</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-13T14:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column of previous value by date &amp; customer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390579#M62154</link>
      <description>&lt;P&gt;thats maybe because i transferred DATE from date/time to date. what can i do?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-of-previous-value-by-date-amp-customer/m-p/2390579#M62154</guid>
      <dc:creator>akfir</dc:creator>
      <dc:date>2022-03-13T14:59:50Z</dc:date>
    </item>
  </channel>
</rss>

