<?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 Calculate average across all categories without showing empty categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461204#M27554</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a visual to show &lt;STRONG&gt;average times per category (bars)&lt;/STRONG&gt; as well as an &lt;STRONG&gt;overall average across ALL categories (dotted line)&lt;/STRONG&gt;. Please see screenshot below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using a Measure to calculate the overall average (dotted line):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Overall Avg = CALCULATE(SUM('Table1'[Work Time])/COUNT('Table1'[Number]),ALLSELECTED('Table1'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation works fine. However, the problem is that the ALLSELECTED() function always returns also &lt;STRONG&gt;empty categories&lt;/STRONG&gt; (see Category D). Especially when there are more empty categories, this looks really ugly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried using ALL(), ALLEXCEPT(), etc. instead of ALLSELECTED() without success. Also, "Show items with no data" is disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any ideas how to fix that? Thanks a million!&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 14:58:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-28T14:58:57Z</dc:date>
    <item>
      <title>Calculate average across all categories without showing empty categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461204#M27554</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a visual to show &lt;STRONG&gt;average times per category (bars)&lt;/STRONG&gt; as well as an &lt;STRONG&gt;overall average across ALL categories (dotted line)&lt;/STRONG&gt;. Please see screenshot below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using a Measure to calculate the overall average (dotted line):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Overall Avg = CALCULATE(SUM('Table1'[Work Time])/COUNT('Table1'[Number]),ALLSELECTED('Table1'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation works fine. However, the problem is that the ALLSELECTED() function always returns also &lt;STRONG&gt;empty categories&lt;/STRONG&gt; (see Category D). Especially when there are more empty categories, this looks really ugly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried using ALL(), ALLEXCEPT(), etc. instead of ALLSELECTED() without success. Also, "Show items with no data" is disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any ideas how to fix that? Thanks a million!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 14:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461204#M27554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-28T14:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average across all categories without showing empty categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461277#M27558</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try if this can work&lt;/P&gt;
&lt;P&gt;Overall Avg = CALCULATE(SUM('Table1'[Work Time])/COUNT('Table1'[Number]),filter(ALLSELECTED('Table1'), not(isblank(Table[category]))))&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 15:29:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461277#M27558</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-10-28T15:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average across all categories without showing empty categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461307#M27564</link>
      <description>&lt;P&gt;&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;Thank you for your fast reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this doesn't work as well. Same result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I want to use this Measure for different "Category" columns. Hence, it should be as generic as possible and I intended not to use the "Category" column itself in the Measure. It might be possible workaround of course... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 15:42:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461307#M27564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-28T15:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average across all categories without showing empty categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461384#M27570</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Create a separate measure for total work time:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Work Time = SUM ( 'Table1'[Work Time] )
&lt;/LI-CODE&gt;
&lt;P&gt;The try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Overall Avg =
CALCULATE (
    DIVIDE ( [Total Work Time], COUNT ( 'Table1'[Number] ) ),
    FILTER ( VALUES ( 'Table'[Category] ), [Total Work Time] &amp;lt;&amp;gt; 0 )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Here is a visual from my dummy data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 16:06:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1461384#M27570</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-10-28T16:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average across all categories without showing empty categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1462897#M27638</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use your approach, I get the average value per category instead of an overall average across the categories (see below). The empty category is not visible now!&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;Not sure if this is important, but the value of my cateogries is not actually 0. Instead, the "empty" categories are hidden due to some applied filters.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:37:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-across-all-categories-without-showing-empty/m-p/1462897#M27638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T09:37:01Z</dc:date>
    </item>
  </channel>
</rss>

