<?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 need help for dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4881762#M185986</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;I have a table with columns: Date, Market, and Potential_dem_Cost. I need to create two measures:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next Month Potential_dem_Cost&lt;/LI&gt;&lt;LI&gt;Next-to-Next Month Potential_dem_Cost&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;These measures should dynamically calculate the Potential_dem_Cost for the next month and the month after that, based on the currently selected month in the filter. For example, if I filter January, the measure should return:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next Month = February’s Potential_dem_Cost&lt;/LI&gt;&lt;LI&gt;Next-to-Next Month = March’s Potential_dem_Cost.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Fri, 21 Nov 2025 06:48:14 GMT</pubDate>
    <dc:creator>tkavitha911</dc:creator>
    <dc:date>2025-11-21T06:48:14Z</dc:date>
    <item>
      <title>need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4881762#M185986</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;I have a table with columns: Date, Market, and Potential_dem_Cost. I need to create two measures:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next Month Potential_dem_Cost&lt;/LI&gt;&lt;LI&gt;Next-to-Next Month Potential_dem_Cost&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;These measures should dynamically calculate the Potential_dem_Cost for the next month and the month after that, based on the currently selected month in the filter. For example, if I filter January, the measure should return:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next Month = February’s Potential_dem_Cost&lt;/LI&gt;&lt;LI&gt;Next-to-Next Month = March’s Potential_dem_Cost.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 21 Nov 2025 06:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4881762#M185986</guid>
      <dc:creator>tkavitha911</dc:creator>
      <dc:date>2025-11-21T06:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4881818#M185987</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;&amp;nbsp;,&amp;nbsp; You can use TI various options are&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;MTD = CALCULATE(AverageX(values('Date'[Date]), calculate(SUM(Table[Qunatity Produced])) ),DATESMTD('Date'[Date]))&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;BR /&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trailing last month = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;next t month = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],1,MONTH))&lt;/P&gt;
&lt;P&gt;Next MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],1,MONTH)))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Power BI: Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/cyWVzAQF9YU?t=41169" target="_blank"&gt;https://youtu.be/cyWVzAQF9YU?t=41169&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;MTD, Last Month, Trailing month &lt;BR /&gt;&lt;A href="https://youtu.be/cyWVzAQF9YU?t=41662" target="_blank"&gt;https://youtu.be/cyWVzAQF9YU?t=41662&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Nov 2025 07:45:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4881818#M185987</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2025-11-21T07:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4882925#M186006</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;You need to use SELECTEDVALUE in your measures to dynamically work with the month selected in the filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next Month Potential_dem_Cost =
VAR SelectedMonth =
    SELECTEDVALUE('Date'[MonthNumber])
VAR SelectedYear =
    SELECTEDVALUE('Date'[Year])
VAR NextMonth =
    IF(SelectedMonth = 12, 1, SelectedMonth + 1)
VAR NextYear =
    IF(SelectedMonth = 12, SelectedYear + 1, SelectedYear)
RETURN
CALCULATE(
    SUM('YourTable'[Potential_dem_Cost]),
    FILTER(
        ALL('Date'),
        'Date'[MonthNumber] = NextMonth &amp;amp;&amp;amp;
        'Date'[Year] = NextYear
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Next-to-Next Month Potential_dem_Cost =
VAR SelectedMonth =
    SELECTEDVALUE('Date'[MonthNumber])
VAR SelectedYear =
    SELECTEDVALUE('Date'[Year])
VAR NextMonth =
    IF(SelectedMonth &amp;gt;= 11, SelectedMonth - 10, SelectedMonth + 2)
VAR NextYear =
    IF(SelectedMonth &amp;gt;= 11, SelectedYear + 1, SelectedYear)
RETURN
CALCULATE(
    SUM('YourTable'[Potential_dem_Cost]),
    FILTER(
        ALL('Date'),
        'Date'[MonthNumber] = NextMonth &amp;amp;&amp;amp;
        'Date'[Year] = NextYear
    )
)&lt;/LI-CODE&gt;&lt;P&gt;--------------------------------&lt;/P&gt;&lt;P&gt;I hope this helps, please give kudos and mark as solved if it does!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Connect with me on &lt;/SPAN&gt;&lt;A href="https://www.linkedin.com/in/alex-ward-30966b4b/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;LinkedIn&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Subscribe to my &lt;/SPAN&gt;&lt;A href="https://www.youtube.com/@AlexTechShed" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;YouTube channel&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; for Fabric/Power Platform related content!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Nov 2025 21:10:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4882925#M186006</guid>
      <dc:creator>wardy912</dc:creator>
      <dc:date>2025-11-22T21:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4886109#M186073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;try below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next Month Potential_dem_Cost = 
CALCULATE(
    SUM('Potential_dem_Cost'[Cost]),
    DATEADD('Date'[Date], 1, MONTH)
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Next-to-Next Month Potential_dem_Cost = 
CALCULATE(
    SUM('Potential_dem_Cost'[Cost]),
    DATEADD('Date'[Date], 2, MONTH)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give kudos or mark it as solution once confirmed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Praful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 04:52:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4886109#M186073</guid>
      <dc:creator>Praful_Potphode</dc:creator>
      <dc:date>2025-11-26T04:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4886251#M186076</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1261729" data-lia-user-login="Praful_Potphode" class="lia-mention lia-mention-user"&gt;Praful_Potphode&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="475583" data-lia-user-login="wardy912" class="lia-mention lia-mention-user"&gt;wardy912&lt;/a&gt; &amp;amp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; ,Thanks for your prompt response&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your patience and look forward to hearing from you.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Prashanth Are&lt;BR /&gt;MS Fabric community support&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 07:11:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4886251#M186076</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-11-26T07:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4895769#M186319</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your patience and look forward to hearing from you.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Prashanth Are&lt;BR /&gt;MS Fabric community support&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 10:00:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4895769#M186319</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-12-08T10:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: need help for dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4895842#M186321</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672212" data-lia-user-login="tkavitha911" class="lia-mention lia-mention-user"&gt;tkavitha911&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Here are two DAX measures that will calculate the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Potential_dem_Cost&lt;/STRONG&gt; &lt;/FONT&gt;for the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;next month&lt;/STRONG&gt; &lt;/FONT&gt;and &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;next-to-next month&lt;/STRONG&gt;&lt;/FONT&gt; based on the currently &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;filtered month&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="4" color="#FF6600"&gt;&lt;STRONG&gt;First Measure:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt;Next Month Potential_dem_Cost&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next Month Potential_dem_Cost = 
VAR CurrentMonthEnd = EOMONTH(MAX('Table'[Date]), 0)
VAR NextMonthStart = EOMONTH(CurrentMonthEnd, 0) + 1
VAR NextMonthEnd = EOMONTH(NextMonthStart, 0)
RETURN
CALCULATE(
    SUM('Table'[Potential_dem_Cost]),
    FILTER(
        ALL('Table'[Date]),
        'Table'[Date] &amp;gt;= NextMonthStart &amp;amp;&amp;amp;
        'Table'[Date] &amp;lt;= NextMonthEnd
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="4" color="#99CC00"&gt;&lt;STRONG&gt;Second Measure:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt;Next-to-Next Month Potential_dem_Cost&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Next-to-Next Month Potential_dem_Cost = 
VAR CurrentMonthEnd = EOMONTH(MAX('Table'[Date]), 0)
VAR NextToNextMonthStart = EOMONTH(CurrentMonthEnd, 1) + 1
VAR NextToNextMonthEnd = EOMONTH(NextToNextMonthStart, 0)
RETURN
CALCULATE(
    SUM('Table'[Potential_dem_Cost]),
    FILTER(
        ALL('Table'[Date]),
        'Table'[Date] &amp;gt;= NextToNextMonthStart &amp;amp;&amp;amp;
        'Table'[Date] &amp;lt;= NextToNextMonthEnd
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#33CCCC"&gt;&lt;FONT face="comic sans ms,sans-serif" size="4"&gt;Alternative Approach:&lt;/FONT&gt;&lt;/FONT&gt;Using &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;DATEADD&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;(if you have a &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;proper date table&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Next Month (with date table)
Next Month Potential_dem_Cost = 
CALCULATE(
    SUM('Table'[Potential_dem_Cost]),
    DATEADD('Date'[Date], 1, MONTH)
)

// Next-to-Next Month (with date table)
Next-to-Next Month Potential_dem_Cost = 
CALCULATE(
    SUM('Table'[Potential_dem_Cost]),
    DATEADD('Date'[Date], 2, MONTH)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="4" color="#FFCC00"&gt;Final Note:&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For some cases when filtering &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;December&lt;/STRONG&gt; &lt;/FONT&gt;and &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;January&lt;/STRONG&gt; &lt;/FONT&gt;may show no data if it doesnt exist you might want to add &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;error handling&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;Next Month Potential_dem_Cost = 
VAR CurrentMonthEnd = EOMONTH(MAX('Table'[Date]), 0)
VAR NextMonthStart = EOMONTH(CurrentMonthEnd, 0) + 1
VAR NextMonthEnd = EOMONTH(NextMonthStart, 0)
VAR Result = 
    CALCULATE(
        SUM('Table'[Potential_dem_Cost]),
        FILTER(
            ALL('Table'[Date]),
            'Table'[Date] &amp;gt;= NextMonthStart &amp;amp;&amp;amp;
            'Table'[Date] &amp;lt;= NextMonthEnd
        )
    )
RETURN
IF(ISBLANK(Result), 0, Result)  // Returns 0 instead of blank&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;if this post helps, then I would appreciate a thumbs up&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;and&amp;nbsp;&lt;STRONG&gt;mark it as the solution&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;to help the other members find it more quickly.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Dec 2025 11:28:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/need-help-for-dax/m-p/4895842#M186321</guid>
      <dc:creator>Ahmed-Elfeel</dc:creator>
      <dc:date>2025-12-08T11:28:05Z</dc:date>
    </item>
  </channel>
</rss>

