<?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: Make a measure with filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974295#M154102</link>
    <description>&lt;P&gt;Then you need to create a 2nd measure. Keep your original measure for filtering per Subject.&lt;/P&gt;&lt;P&gt;Use this for the whole Average&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average All =
VAR _AllMistakes = CALCULATE(SUM('Technical Research'[Number of Mistakes]), ALL ('Technical Research'))
VAR _AllSubjects = CALCULATE(COUNT('Technical Research'[Subjects]), ALL ('Technical Research'))

RETURN
DIVIDE(_AllMistakes, _AllSubjects, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change Count to Distinctcount if you are looking for unique number for teh subjects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add both measures to the Visual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2024 12:29:42 GMT</pubDate>
    <dc:creator>Joe_Barry</dc:creator>
    <dc:date>2024-06-05T12:29:42Z</dc:date>
    <item>
      <title>Make a measure with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3973781#M154084</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make a visual to compare all data with the data of an selected filter. I thougt I would do this with a measure. This is my measure for all data:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Average mistakes total =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('Technical Research'[Number of Mistakes]), [Number of subjects])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But now I want to add a filter into the measure, I want the average of the mistakes from only one subject. I tried something like this:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Average mistakes subject&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Technical Research'&lt;/SPAN&gt;&lt;SPAN&gt;[Numer of Mistakes]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;[Number of subjects]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Data of Subjects'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;[Subject]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"1"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I hope you'll understand what I mean! Thank you in forward.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jun 2024 10:13:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3973781#M154084</guid>
      <dc:creator>Noadekat</dc:creator>
      <dc:date>2024-06-05T10:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Make a measure with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974220#M154098</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="672295" data-lia-user-login="Noadekat" class="lia-mention lia-mention-user"&gt;Noadekat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your measure looks good, but have you tried adding a slicer with the subjects on the page? When you choose a subject, the measure will automatically filter to the Average of that Subject. Also in a Table visual, you can add the subjects and your measure and it will also filter to the Average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that what you need? Maybe provide a clearer example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 12:09:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974220#M154098</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-06-05T12:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Make a measure with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974246#M154099</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou for your answer. The problem is that I want both averages in one visual, so the average of all subjects ánd the average of only one subject. In that way you can compare them to eachother. If I make a slicer, the slicer will effect both lines.&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;</description>
      <pubDate>Wed, 05 Jun 2024 12:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974246#M154099</guid>
      <dc:creator>Noadekat</dc:creator>
      <dc:date>2024-06-05T12:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Make a measure with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974295#M154102</link>
      <description>&lt;P&gt;Then you need to create a 2nd measure. Keep your original measure for filtering per Subject.&lt;/P&gt;&lt;P&gt;Use this for the whole Average&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average All =
VAR _AllMistakes = CALCULATE(SUM('Technical Research'[Number of Mistakes]), ALL ('Technical Research'))
VAR _AllSubjects = CALCULATE(COUNT('Technical Research'[Subjects]), ALL ('Technical Research'))

RETURN
DIVIDE(_AllMistakes, _AllSubjects, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change Count to Distinctcount if you are looking for unique number for teh subjects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add both measures to the Visual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 12:29:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Make-a-measure-with-filter/m-p/3974295#M154102</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-06-05T12:29:42Z</dc:date>
    </item>
  </channel>
</rss>

