<?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 Help Needed with DAX Expression for Current and Future Month Calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4057291#M161025</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I’m working on a DAX expression to calculate a display value for a line chart in Power BI. My goal is to correctly handle data for the current month and future months with the following requirements:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;For the current month:&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;I need to combine the cumulative sum of actual values with the rolling wave forecast value.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;For future months:&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;The display value should consist of the cumulative sum of the actual values from the current month plus the forecast value for that future month.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;STRONG&gt;Here's the DAX expression I have so far:&lt;/STRONG&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Display Value =&lt;BR /&gt;VAR IsCurrentMonth =&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;/P&gt;&lt;P&gt;VAR IsFutureMonth =&lt;BR /&gt;YEAR([Date]) &amp;gt; YEAR(TODAY()) ||&lt;BR /&gt;(YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp; MONTH([Date]) &amp;gt; MONTH(TODAY()))&lt;/P&gt;&lt;P&gt;VAR CurrentMonthActualCumulativeSum =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX([Actual Cumulative.Sum]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED(),&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;[Series Type] = "Rolling Wave Forecast",&lt;BR /&gt;IF(&lt;BR /&gt;IsCurrentMonth,&lt;BR /&gt;[Actual+Rolling Wave Forecast],&lt;BR /&gt;IF(&lt;BR /&gt;IsFutureMonth,&lt;BR /&gt;CurrentMonthActualCumulativeSum + [Value],&lt;BR /&gt;[Actual+Rolling Wave Forecast]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[Value]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;When I add this measure to a line chart, the current month’s values display correctly. However, for future months, the cumulative sum is incorrectly added multiple times. For example, in the next month, the cumulative sum of the actual values from the current month is added again, and this continues to accumulate incorrectly in subsequent months.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;&lt;STRONG&gt;What I Need:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;I need the calculation to add the cumulative sum of the actual values only once for the current month and then add the forecast value for each future month without repeating the cumulative sum.&lt;BR /&gt;Any guidance on how to fix this issue would be greatly appreciated!&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;(Images with captions are below)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&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>Tue, 23 Jul 2024 20:41:06 GMT</pubDate>
    <dc:creator>Jules102</dc:creator>
    <dc:date>2024-07-23T20:41:06Z</dc:date>
    <item>
      <title>Help Needed with DAX Expression for Current and Future Month Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4057291#M161025</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I’m working on a DAX expression to calculate a display value for a line chart in Power BI. My goal is to correctly handle data for the current month and future months with the following requirements:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;For the current month:&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;I need to combine the cumulative sum of actual values with the rolling wave forecast value.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;For future months:&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;The display value should consist of the cumulative sum of the actual values from the current month plus the forecast value for that future month.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;STRONG&gt;Here's the DAX expression I have so far:&lt;/STRONG&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Display Value =&lt;BR /&gt;VAR IsCurrentMonth =&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;/P&gt;&lt;P&gt;VAR IsFutureMonth =&lt;BR /&gt;YEAR([Date]) &amp;gt; YEAR(TODAY()) ||&lt;BR /&gt;(YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp; MONTH([Date]) &amp;gt; MONTH(TODAY()))&lt;/P&gt;&lt;P&gt;VAR CurrentMonthActualCumulativeSum =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX([Actual Cumulative.Sum]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED(),&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;[Series Type] = "Rolling Wave Forecast",&lt;BR /&gt;IF(&lt;BR /&gt;IsCurrentMonth,&lt;BR /&gt;[Actual+Rolling Wave Forecast],&lt;BR /&gt;IF(&lt;BR /&gt;IsFutureMonth,&lt;BR /&gt;CurrentMonthActualCumulativeSum + [Value],&lt;BR /&gt;[Actual+Rolling Wave Forecast]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[Value]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;When I add this measure to a line chart, the current month’s values display correctly. However, for future months, the cumulative sum is incorrectly added multiple times. For example, in the next month, the cumulative sum of the actual values from the current month is added again, and this continues to accumulate incorrectly in subsequent months.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;&lt;STRONG&gt;What I Need:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;I need the calculation to add the cumulative sum of the actual values only once for the current month and then add the forecast value for each future month without repeating the cumulative sum.&lt;BR /&gt;Any guidance on how to fix this issue would be greatly appreciated!&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;(Images with captions are below)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&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>Tue, 23 Jul 2024 20:41:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4057291#M161025</guid>
      <dc:creator>Jules102</dc:creator>
      <dc:date>2024-07-23T20:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed with DAX Expression for Current and Future Month Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4057987#M161059</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="779724" data-lia-user-login="Jules102" class="lia-mention lia-mention-user"&gt;Jules102&lt;/a&gt;&amp;nbsp;, First I would like to say good work in explaining the issue , please find the updated measure try using it once&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Display Value =&lt;BR /&gt;VAR IsCurrentMonth =&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;/P&gt;
&lt;P&gt;VAR IsFutureMonth =&lt;BR /&gt;YEAR([Date]) &amp;gt; YEAR(TODAY()) ||&lt;BR /&gt;(YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp; MONTH([Date]) &amp;gt; MONTH(TODAY()))&lt;/P&gt;
&lt;P&gt;VAR CurrentMonthActualCumulativeSum =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX([Actual Cumulative.Sum]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('YourTableName'),&lt;BR /&gt;YEAR([Date]) = YEAR(TODAY()) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH([Date]) = MONTH(TODAY())&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR FutureMonthForecastValue =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM([Value]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('YourTableName'),&lt;BR /&gt;[Series Type] = "Rolling Wave Forecast" &amp;amp;&amp;amp;&lt;BR /&gt;[Date] = EARLIER([Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;[Series Type] = "Rolling Wave Forecast",&lt;BR /&gt;IF(&lt;BR /&gt;IsCurrentMonth,&lt;BR /&gt;[Actual+Rolling Wave Forecast],&lt;BR /&gt;IF(&lt;BR /&gt;IsFutureMonth,&lt;BR /&gt;CurrentMonthActualCumulativeSum + FutureMonthForecastValue,&lt;BR /&gt;[Actual+Rolling Wave Forecast]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[Value]&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 06:10:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4057987#M161059</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-07-24T06:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed with DAX Expression for Current and Future Month Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4058038#M161062</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="779724" data-lia-user-login="Jules102" class="lia-mention lia-mention-user"&gt;Jules102&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to reproduce your situation, but I found that I didn't have your specific data&lt;/P&gt;
&lt;P&gt;I've also double-checked the dax you offered, according to your logic, there is no problem with it.&lt;/P&gt;
&lt;P&gt;So I&amp;nbsp;speculate that maybe&amp;nbsp;the [Value] is the problem.&lt;/P&gt;
&lt;P&gt;If possible, could you please provide some raw data(exclude sensitive data), or create some sample data, so that we can help you better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 06:30:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4058038#M161062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-24T06:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help Needed with DAX Expression for Current and Future Month Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4059241#M161108</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your previous assistance. I need to provide additional context regarding my issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm using the following DAX expression to display data on the y-axis:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Spend NEW =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Budget/Spend by Category'[Display Value2]),&lt;BR /&gt;FILTER(ALL('Calendar'[Date]), 'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date]))&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;U&gt;Data Structure:&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;I have a table where each row represents a budget or spend entry, and the granularity is one row per series type per month.&lt;/LI&gt;&lt;LI&gt;The column [Series Type] contains different categories, including "Actual" and "Rolling Wave Forecast".&lt;/LI&gt;&lt;LI&gt;[Actual Cumulative.Sum] represents a cumulative sum of actual values up to the current month.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;U&gt;Objective:&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;I need to calculate a display value (Display Value) that correctly combines actuals and forecasts for the current and future months.&lt;/LI&gt;&lt;LI&gt;Specifically, for the current month, I need to add the actual cumulative sum to the rolling wave forecast.&lt;/LI&gt;&lt;LI&gt;For future months, I want to display the cumulative actual sum for the current month added to each month's rolling wave forecast.&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;&lt;U&gt;&lt;STRONG&gt;Current Problem&lt;/STRONG&gt;&lt;/U&gt;&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;When I plot Cumulative Spend NEW on a line chart, the values for "Rolling Wave Forecast" are significantly higher than expected. It appears that the cumulative sum is being over-counted, possibly due to the way Display Value2 is being calculated or aggregated.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;&lt;U&gt;&lt;STRONG&gt;&lt;STRONG&gt;Additional Observations:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/U&gt;&lt;UL&gt;&lt;LI&gt;The values for the current month seem accurate.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;In future months, the "Rolling Wave Forecast" values appear inflated, potentially due to repeated addition of the cumulative actual sum.I would appreciate any insights or suggestions on how to correct this calculation to ensure an accurate representation of the data on the line chart.&lt;DIV&gt;&lt;BR /&gt;Thank you for your help!&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Anonymous&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 14:16:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-Needed-with-DAX-Expression-for-Current-and-Future-Month/m-p/4059241#M161108</guid>
      <dc:creator>Jules102</dc:creator>
      <dc:date>2024-07-24T14:16:43Z</dc:date>
    </item>
  </channel>
</rss>

