<?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: Measure with historical aging data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685523#M80613</link>
    <description>&lt;P&gt;UPDATE:&amp;nbsp;&lt;BR /&gt;Still didnt manage to figure this out. Here a bit more description:&lt;BR /&gt;I basically want to do what is done in this video:&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=5_KDJGPjMnI" target="_blank"&gt;https://www.youtube.com/watch?v=5_KDJGPjMnI&lt;/A&gt;&lt;BR /&gt;except for in stead of a slicer i need the values for this week and last weeks Accounts Receivable.&amp;nbsp;&lt;BR /&gt;So the table in circled RED in the image for this week AND for last week.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Currently I can do the grouping in calculated columns and make two separate report tables with the grouped data. However I want to have 1 pivot table with the grouping and the AR values of this week AND the AR value sof last week.&amp;nbsp;&lt;BR /&gt;Who can help me please? Let me know if I need to explain more or more info is needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOUU!!&lt;/P&gt;</description>
    <pubDate>Sun, 07 Aug 2022 10:00:15 GMT</pubDate>
    <dc:creator>Leggies</dc:creator>
    <dc:date>2022-08-07T10:00:15Z</dc:date>
    <item>
      <title>Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2677665#M80057</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi community,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Over the last few days I have been struggling with the following issue:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For my company I need to divide the accounts receivable by aging (&amp;lt;30 days, 30-60 days, 60-90 days, 90+ days). So far so good this is an pretty straightforward thing to do in a calculated column. However, I also need the accounts receivable by age from last week in the same table in my report.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this case the calculated column approach doesn’t work anymore and I will have to start working with measures. I got as far as trying to create a measure per age group looking as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open 0-30 =&lt;/P&gt;&lt;P&gt;VAR lastday = MIN(CalendarTable[EOWEEK])&lt;/P&gt;&lt;P&gt;RETURN CALCULATE(SUM('AccountMutations'[AR]), DATESINPERIOD('AccountMutations'[Date], lastday-30, lastday, day))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open 30-60 =&lt;/P&gt;&lt;P&gt;VAR lastday = MIN(CalendarTable[EOWEEK])&lt;/P&gt;&lt;P&gt;RETURN CALCULATE(SUM('AccountMutations'[AR]), DATESINPERIOD('AccountMutations'[Date], lastday-60, lastday-30, day))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, when I put this in a report table per week this seems to not give me the results I want but in stead gives me the overall difference in AR over the past week (ignoring my aging filter on the measure). I have been looking everywhere and found some ideas for dynamic aging with slicers but nowhere a solution to put the aging of this week and last week next to eachother in a report table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone think of why this does not work and how to fix it? All creative solutions are super welcome!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 08:16:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2677665#M80057</guid>
      <dc:creator>Leggies</dc:creator>
      <dc:date>2022-08-03T08:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685523#M80613</link>
      <description>&lt;P&gt;UPDATE:&amp;nbsp;&lt;BR /&gt;Still didnt manage to figure this out. Here a bit more description:&lt;BR /&gt;I basically want to do what is done in this video:&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=5_KDJGPjMnI" target="_blank"&gt;https://www.youtube.com/watch?v=5_KDJGPjMnI&lt;/A&gt;&lt;BR /&gt;except for in stead of a slicer i need the values for this week and last weeks Accounts Receivable.&amp;nbsp;&lt;BR /&gt;So the table in circled RED in the image for this week AND for last week.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Currently I can do the grouping in calculated columns and make two separate report tables with the grouped data. However I want to have 1 pivot table with the grouping and the AR values of this week AND the AR value sof last week.&amp;nbsp;&lt;BR /&gt;Who can help me please? Let me know if I need to explain more or more info is needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOUU!!&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 10:00:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685523#M80613</guid>
      <dc:creator>Leggies</dc:creator>
      <dc:date>2022-08-07T10:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685538#M80615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321106" data-lia-user-login="Leggies" class="lia-mention lia-mention-user"&gt;Leggies&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This does not seem to be overly complex judging by the video...&lt;/P&gt;&lt;P&gt;Can you please supply example data? I don't want to type everything by hand. There does not need to be a lot of it, just enough to demonstrate that it works correctly. The data can be fake, of course, but feel free to supply whatever you want. As long as it's relevant it's OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, it's better to provide a link to a shared file (can be Excel, csv, tab-delim... you name it) instead of pasting something in here. The tables that this site renders are just awful and horrible as if they'd been designed in the XIX century. I wish the administrators of the site provided a better environment for us... and this awful styling has been going on and on and on... What a shame.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 11:02:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685538#M80615</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-07T11:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685700#M80650</link>
      <description>&lt;P&gt;Hey &lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="349489" data-lia-user-login="daXtreme" class="lia-mention lia-mention-user"&gt;daXtreme&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reaction. I thought it shouldnt be too complicated but got completely stuck. Please find some sample data in the link below (hope its enough, please let me know). so would like to end up with a table with 0-30,30-60 etc categories and the AR that belongs to those per week. So how much AR total was between 0-30 days old this week and which were 0-30 days old last week etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Sample data" href="https://docs.google.com/spreadsheets/d/1xjos3l8Kqz1ndRW9MUqiu9n_APkEoj0ra9t3xQqU5jc/edit?usp=sharing" target="_blank" rel="noopener"&gt;https://docs.google.com/spreadsheets/d/1xjos3l8Kqz1ndRW9MUqiu9n_APkEoj0ra9t3xQqU5jc/edit?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 18:42:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685700#M80650</guid>
      <dc:creator>Leggies</dc:creator>
      <dc:date>2022-08-07T18:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685750#M80655</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;DEFINE 

MEASURE Accounts[AR Total] = SUM( Accounts[AR] )

MEASURE 'Account Categories'[# Accounts (This Week)] = 
var CountOfAccountsInSelectedCategories =
    sumx(
        'Account Categories',
        var LowerEndInclusive = 'Account Categories'[Lower End]
        var UpperEndExclusive = 'Account Categories'[Upper End]
        var CountOfAccounts =
            CALCULATE(
                DISTINCTCOUNT( Accounts[Relation] ),
                keepfilters( LowerEndInclusive &amp;lt;= Accounts[Days Open this week] ),
                keepfilters( Accounts[Days Open this week] &amp;lt; UpperEndExclusive )
            )
        return
            CountOfAccounts
    )
return
    CountOfAccountsInSelectedCategories
    
    
MEASURE 'Account Categories'[AR Total (Last Week)] = 
var ARTotal =
    sumx(
        'Account Categories',
        var LowerEndInclusive = 'Account Categories'[Lower End]
        var UpperEndExclusive = 'Account Categories'[Upper End]
        var AccountsTotal =
            CALCULATE(
                [AR Total],
                keepfilters( LowerEndInclusive &amp;lt;= Accounts[Days Open last week] ),
                keepfilters( Accounts[Days Open last week] &amp;lt; UpperEndExclusive )
            )
        return
            AccountsTotal
    )
return
    ARTotal
    
    
MEASURE 'Account Categories'[AR Total (This Week)] = 
var ARTotal =
    sumx(
        'Account Categories',
        var LowerEndInclusive = 'Account Categories'[Lower End]
        var UpperEndExclusive = 'Account Categories'[Upper End]
        var AccountsTotal =
            CALCULATE(
                [AR Total],
                keepfilters( LowerEndInclusive &amp;lt;= Accounts[Days Open this week] ),
                keepfilters( Accounts[Days Open this week] &amp;lt; UpperEndExclusive )
            )
        return
            AccountsTotal
    )
return
    ARTotal


MEASURE 'Account Categories'[# Accounts (Last Week)] = 
var CountOfAccountsInSelectedCategories =
    sumx(
        'Account Categories',
        var LowerEndInclusive = 'Account Categories'[Lower End]
        var UpperEndExclusive = 'Account Categories'[Upper End]
        var CountOfAccounts =
            CALCULATE(
                DISTINCTCOUNT( Accounts[Relation] ),
                keepfilters( LowerEndInclusive &amp;lt;= Accounts[Days Open last week] ),
                keepfilters( Accounts[Days Open last week] &amp;lt; UpperEndExclusive )
            )
        return
            CountOfAccounts
    )
return
    CountOfAccountsInSelectedCategories&lt;/LI-CODE&gt;&lt;P&gt;And here's the Account Categories table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Note the intervals are left-closed-right-open. You can have it the other way round but you'll have to adjust the measures. It's easy.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 20:24:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685750#M80655</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-07T20:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685751#M80656</link>
      <description>&lt;P&gt;&lt;STRONG&gt;By the way... The Accounts Categories table has no relationship with any other table. It's free-standing, disconnected.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 20:25:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2685751#M80656</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-07T20:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Measure with historical aging data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2686467#M80710</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="349489" data-lia-user-login="daXtreme" class="lia-mention lia-mention-user"&gt;daXtreme&lt;/a&gt;&amp;nbsp;THANK YOU!!!&amp;nbsp;&lt;BR /&gt;This is def the way to go! I am really close to getting the right amounts now! Super gratefull, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 07:12:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-with-historical-aging-data/m-p/2686467#M80710</guid>
      <dc:creator>Leggies</dc:creator>
      <dc:date>2022-08-08T07:12:06Z</dc:date>
    </item>
  </channel>
</rss>

