<?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: It just won't work!  HELP in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4075011#M161787</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need a cumulative value for the current year and it resets when the next year starts? The below measure with calculate the Average based on the Month chosen. You will need a Date table (See my bio below)&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Avg. Actual = 
VAR NumOfMonths =
    MAX ( 'DIM Date'[Month] )
VAR LastCurrentDate =
    MAX ( 'DIM Date'[Date] )
VAR Period =
    DATESINPERIOD ( 'DIM Date'[Date], LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
    CALCULATE (
        AVERAGEX ( VALUES ( 'DIM Date'[Month-Year] ), [Actual] ),///YOUR MEASURE HERE
        Period
    )
VAR FirstDateInPeriod =
    MINX ( Period, 'DIM Date'[Date] )
VAR LastDateWithSales =
    MAX ( 'CustomerSat'[Date] ) /// YOUR TABLE AND RESULT DATE HERE
RETURN
    IF ( FirstDateInPeriod &amp;lt;= LastDateWithSales, Result )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2024 05:04:28 GMT</pubDate>
    <dc:creator>Joe_Barry</dc:creator>
    <dc:date>2024-08-02T05:04:28Z</dc:date>
    <item>
      <title>It just won't work!  HELP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4074794#M161779</link>
      <description>&lt;P&gt;'ve built all of 1 simple dashboard in my life, and now my brand new boss has asked me to put together a similar dashboard to this image, I've created it in Excel but I need to put it into a BI dashboard that executive leadership can manipulate.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have very much similar data, with no prior year and forecasted/actual data, pulled on a monthly basis. I'm struggling on the running average (to replace cumulative) depending on the month selected. I have 2 different tables with actual and forecasted data (each criteria is a separate row with month).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to use solutions found in other posts on here (Average YTD Calculation Based on User Selection)&lt;/P&gt;&lt;PRE&gt;Average Planned YTD =
VAR SelectedPeriod =
    SELECTEDVALUE ( 'Table'[Period] )
VAR MaxPeriod =
    MAX ( 'Table'[Period] )
RETURN
    IF (
        SelectedPeriod = BLANK (),
        [Planned (YTD)] / MaxPeriod,
        [Planned (YTD)] / SelectedPeriod
    )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and have watched Youtube after Youtube videos and I'm still missing something.&amp;nbsp; I just need to be able to show that by selecting May, it'll calculate (by measure) the YTD average for actual and forecasted, which I can then setup conditional formatting for the variance.&amp;nbsp; Any guidance would be extremely helpful!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 02:53:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4074794#M161779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-02T02:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: It just won't work!  HELP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4075011#M161787</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need a cumulative value for the current year and it resets when the next year starts? The below measure with calculate the Average based on the Month chosen. You will need a Date table (See my bio below)&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Avg. Actual = 
VAR NumOfMonths =
    MAX ( 'DIM Date'[Month] )
VAR LastCurrentDate =
    MAX ( 'DIM Date'[Date] )
VAR Period =
    DATESINPERIOD ( 'DIM Date'[Date], LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
    CALCULATE (
        AVERAGEX ( VALUES ( 'DIM Date'[Month-Year] ), [Actual] ),///YOUR MEASURE HERE
        Period
    )
VAR FirstDateInPeriod =
    MINX ( Period, 'DIM Date'[Date] )
VAR LastDateWithSales =
    MAX ( 'CustomerSat'[Date] ) /// YOUR TABLE AND RESULT DATE HERE
RETURN
    IF ( FirstDateInPeriod &amp;lt;= LastDateWithSales, Result )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 05:04:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4075011#M161787</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-08-02T05:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: It just won't work!  HELP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4075985#M161833</link>
      <description>&lt;P&gt;Hi Joe, thank you so much for your quick response! I'm running into an issue with [Actual], I created a FACT table with the actual/forecast values, but when I try to use&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'FACT_Combined'[Actual], it gives me an error:&amp;nbsp;&amp;nbsp;&lt;EM&gt;A single value for column 'Actual' in table 'FACT_Combined' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;it's part of an Average formula, so I'm not sure why it won't average the data in that column (although that's not what I want either, but it's a start)&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Aug 2024 12:27:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/It-just-won-t-work-HELP/m-p/4075985#M161833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-02T12:27:02Z</dc:date>
    </item>
  </channel>
</rss>

