<?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: Calculating dynamic average of y-axis based on multiple x-axis value selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059886#M105669</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508629" data-lia-user-login="Mr_Singhal" class="lia-mention lia-mention-user"&gt;Mr_Singhal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you want the average to change every month or with a quarter?&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year=year(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;By month:&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;month=Month(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;Create the measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        table[Model] = SELECTEDVALUE ( table[Model] )
            &amp;amp;&amp;amp; table[year] = SELECTEDVALUE ( table[year] )
            &amp;amp;&amp;amp; table[month] = SELECTEDVALUE ( table[month] )
    ),
    'Table'[Y axis]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By quarter:&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Quarter(quarter(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;Then create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Model] = SELECTEDVALUE ( 'Table'[Model] )
            &amp;amp;&amp;amp; table[year] = SELECTEDVALUE ( table[year] )
            &amp;amp;&amp;amp; table[quarter] = SELECTEDVALUE ( table[quarter] )
    ),
    'Table'[Y axis]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please add a column with the desired output with the above data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 08:16:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-03T08:16:35Z</dc:date>
    <item>
      <title>Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3057794#M105547</link>
      <description>&lt;P&gt;I am working on a database which has 1 value on y-axis and 3 columns on the x-axis (date, time, model). I have 3 slicers for the selection of these values on the x-axis. Sample snippet of data is attached below.&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;&lt;P&gt;I want to add a new line on my line chart which shows the average of the y-axis values based on the selection. This will be a dynamic average that would be changing based on selected x-axis values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Power BI but I tried googling the results but couldn't find anything. Any assistance would be highly appreciated. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 12:30:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3057794#M105547</guid>
      <dc:creator>Mr_Singhal</dc:creator>
      <dc:date>2023-02-02T12:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059307#M105632</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508629" data-lia-user-login="Mr_Singhal" class="lia-mention lia-mention-user"&gt;Mr_Singhal&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = AVERAGEX(FILTER(ALL('Table'),'Table'[Model]=SELECTEDVALUE('Table'[Model])),'Table'[Y axis])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 02:04:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059307#M105632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-03T02:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059857#M105666</link>
      <description>&lt;P&gt;Thank you for the answer, it works well for giving me the average when I am changing the model only. But when I change time or date for the same model number, the measure value isn't changing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I mean is say for the model no: AM120 the measure value is same for the first quarter and for the second quarter when in reality they should be changing as date and time change.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 08:04:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059857#M105666</guid>
      <dc:creator>Mr_Singhal</dc:creator>
      <dc:date>2023-02-03T08:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059886#M105669</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508629" data-lia-user-login="Mr_Singhal" class="lia-mention lia-mention-user"&gt;Mr_Singhal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you want the average to change every month or with a quarter?&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year=year(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;By month:&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;month=Month(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;Create the measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        table[Model] = SELECTEDVALUE ( table[Model] )
            &amp;amp;&amp;amp; table[year] = SELECTEDVALUE ( table[year] )
            &amp;amp;&amp;amp; table[month] = SELECTEDVALUE ( table[month] )
    ),
    'Table'[Y axis]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By quarter:&lt;/P&gt;
&lt;P&gt;Create a column first.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Quarter(quarter(table[date])&lt;/LI-CODE&gt;
&lt;P&gt;Then create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Model] = SELECTEDVALUE ( 'Table'[Model] )
            &amp;amp;&amp;amp; table[year] = SELECTEDVALUE ( table[year] )
            &amp;amp;&amp;amp; table[quarter] = SELECTEDVALUE ( table[quarter] )
    ),
    'Table'[Y axis]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please add a column with the desired output with the above data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 08:16:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059886#M105669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-03T08:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059941#M105673</link>
      <description>&lt;P&gt;The quarter or month is just an example, i want to be able to select any random date duration. For example between: 01 Nov to 31 Dec. or for random time duration like 1000 hrs to 2200 hrs. or a combination of all date, time and model together.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 08:38:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059941#M105673</guid>
      <dc:creator>Mr_Singhal</dc:creator>
      <dc:date>2023-02-03T08:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating dynamic average of y-axis based on multiple x-axis value selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059954#M105674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508629" data-lia-user-login="Mr_Singhal" class="lia-mention lia-mention-user"&gt;Mr_Singhal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If so, please try to use slicer select the date range.&lt;/P&gt;
&lt;P&gt;Put the date column into the slicer.&lt;/P&gt;
&lt;P&gt;Then create the measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _mindate =
    MINX ( ALLSELECTED ( 'table' ), 'table'[date] )
VAR _maxdate =
    MAXX ( ALLSELECTED ( 'table' ), 'table'[date] )
RETURN
    AVERAGEX (
        FILTER (
            ALL ( 'table' ),
            'table'[date] &amp;lt;= _maxdate
                &amp;amp;&amp;amp; 'table'[date] &amp;gt; + _mindate
                &amp;amp;&amp;amp; 'Table'[Model] = SELECTEDVALUE ( 'Table'[Model] )
        ),
        'table'[value]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If it does not help, &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;please add a column with the desired output with the above data.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 08:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-dynamic-average-of-y-axis-based-on-multiple-x-axis/m-p/3059954#M105674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-03T08:49:37Z</dc:date>
    </item>
  </channel>
</rss>

