<?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: Forecast future 18 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2378804#M61389</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223826" data-lia-user-login="BGB" class="lia-mention lia-mention-user"&gt;BGB&lt;/a&gt;&amp;nbsp;Maybe use simple linear regression?&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Simple-Linear-Regression/m-p/247439#M55" target="_blank"&gt;Simple Linear Regression - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 13:50:28 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2022-03-07T13:50:28Z</dc:date>
    <item>
      <title>Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2378726#M61388</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the forecast for this data for the next 18 months. The 18 months need to be dynamic and only when the status is "Active".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The forecast figure for the next 18 months is the budget figure divided by 9.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This forecast needs to show on a table for the 18 months straight and not just in the total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the data example below and thanks in advance.&lt;/P&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;</description>
      <pubDate>Mon, 07 Mar 2022 13:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2378726#M61388</guid>
      <dc:creator>BGB</dc:creator>
      <dc:date>2022-03-07T13:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2378804#M61389</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223826" data-lia-user-login="BGB" class="lia-mention lia-mention-user"&gt;BGB&lt;/a&gt;&amp;nbsp;Maybe use simple linear regression?&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Simple-Linear-Regression/m-p/247439#M55" target="_blank"&gt;Simple Linear Regression - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 13:50:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2378804#M61389</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-03-07T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379417#M61433</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;There is no need for prediction in this one. The forecast just needs to have the total budget divided by 9 for months greater than this month.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:24:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379417#M61433</guid>
      <dc:creator>BGB</dc:creator>
      <dc:date>2022-03-07T18:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379434#M61435</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223826" data-lia-user-login="BGB" class="lia-mention lia-mention-user"&gt;BGB&lt;/a&gt;&amp;nbsp;So like this?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Project = MAX('Table'[Project ID])
  VAR __Budget = SUMX(FILTER(ALL('Table'),[Project ID] = __Project),[Budget])
RETURN
  __Budget / 9&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:33:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379434#M61435</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-03-07T18:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379774#M61455</link>
      <description>&lt;P&gt;To help with this, my desire outcome is below.&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;</description>
      <pubDate>Mon, 07 Mar 2022 23:12:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2379774#M61455</guid>
      <dc:creator>BGB</dc:creator>
      <dc:date>2022-03-07T23:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2385716#M61788</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223826" data-lia-user-login="BGB" class="lia-mention lia-mention-user"&gt;BGB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;calculated column&lt;/STRONG&gt; as below to get it, please find the details in&lt;EM&gt;&lt;STRONG&gt; the attachmen&lt;/STRONG&gt;&lt;/EM&gt;t:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Forecast Budget = 
VAR _budget =
    CALCULATE (
        FIRSTNONBLANK ( 'Table'[Budget], 'Table'[Budget] ),
        FILTER ( 'Table', 'Table'[Project ID] = EARLIER ( 'Table'[Project ID] ) )
    )
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            'Table',
            'Table'[Project ID] = EARLIER ( 'Table'[Project ID] )
                &amp;amp;&amp;amp; NOT ( ISBLANK ( 'Table'[Budget] ) )
        )
    )
RETURN
    IF (
        'Table'[Date] = _date,
        'Table'[Budget],
        IF (
            DATEDIFF ( _date, 'Table'[Date], MONTH ) &amp;lt;= 18
                &amp;amp;&amp;amp; ISBLANK ( 'Table'[Actual Cost] )
                &amp;amp;&amp;amp; 'Table'[Status Closed]="Active",
            DIVIDE ( _budget, 9 ),
            BLANK ()
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 09:41:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2385716#M61788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2385864#M61805</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Thanks so much for this. This gives me a lot of hope that this is possible within Power BI.&lt;BR /&gt;&lt;BR /&gt;Is this possible to use a DateTable instead of a hardcoded future date? The reason is that I have more than 100,000 Project ID and I can not hardcode the future date as you have done in your example. Also, the future date will be more dynamic. I'm guessing this will be more of a measure calculation but I'm happy to use columns if we can make that dynamic too.&lt;BR /&gt;&lt;BR /&gt;Really appreciate your effort on this. your result already blew my mind&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:48:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2385864#M61805</guid>
      <dc:creator>BGB</dc:creator>
      <dc:date>2022-03-10T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2387803#M61954</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="223826" data-lia-user-login="BGB" class="lia-mention lia-mention-user"&gt;BGB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I updated my sample pbix file, please check whether that is what you want.&lt;/P&gt;
&lt;P&gt;1. Create a date dimension table&lt;/P&gt;
&lt;P&gt;2. Create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below to get the forecast budget&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _selproject =
    SELECTEDVALUE ( 'Table'[Project ID] )
VAR _budget =
    CALCULATE (
        FIRSTNONBLANK ( 'Table'[Budget], 'Table'[Budget] ),
        FILTER ( 'Table', 'Table'[Project ID] = _selproject )
    )
VAR _date =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Project ID] = _selproject
                &amp;amp;&amp;amp; NOT ( ISBLANK ( 'Table'[Budget] ) )
        )
    )
RETURN
    IF (
        _seldate = _date,
        _budget,
        IF (
            DATEDIFF ( _date, _seldate, MONTH ) &amp;gt;= 0
                &amp;amp;&amp;amp; DATEDIFF ( _date, _seldate, MONTH ) &amp;lt;= 18,
            CALCULATE (
                DIVIDE ( _budget, 9 ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[Status Closed] = "Active"
                        &amp;amp;&amp;amp; ISBLANK ( 'Table'[Actual Cost] )
                )
            ),
            BLANK ()
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;3. Create a table visual as below screenshot&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 05:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2387803#M61954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-11T05:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Forecast future 18 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2388915#M62039</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;You are definitely a genius, no doubt, but I don't think I do an excellent job at explaining.&lt;BR /&gt;Your table shows the budget how I want it, but the budget needs to stay on the same table as the actual. when I drag actual to the table as there is no relationship, actual shows on every row because there is no relationship between datetable and fact table. Picture 1&lt;BR /&gt;&lt;BR /&gt;However, when I connect the tables the measure doesn't work. Picture 2&lt;BR /&gt;&lt;BR /&gt;I dont really have to use the datetable as long we can display both actual and budget on the same table when actual is in the past and budget starts from next month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I also changed you variable&amp;nbsp;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_date to calculate today instead of from the start of the calendar. This is to allow the budget to be in the future. Date worked after change but I cant but actual and budget on the same table is the problem.&lt;BR /&gt;&lt;BR /&gt;Sorry for being a pain but I think you are already there now and I probably just need to change one simple thing to make it right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Picture 1:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Picture 2:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:23:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Forecast-future-18-months/m-p/2388915#M62039</guid>
      <dc:creator>BGB</dc:creator>
      <dc:date>2022-03-11T15:23:19Z</dc:date>
    </item>
  </channel>
</rss>

