<?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: Count number of times something happens in measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3841463#M150175</link>
    <description>&lt;P&gt;Hi Yilong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help! However, I needed to add more information to the measure, and now I am stuck again. Could you maybe help me with this one:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/td-p/3820146" target="_blank"&gt;Count number of times something happens in measure - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 12:24:31 GMT</pubDate>
    <dc:creator>crl_91</dc:creator>
    <dc:date>2024-04-16T12:24:31Z</dc:date>
    <item>
      <title>Count number of times something happens in measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3779775#M147687</link>
      <description>&lt;P&gt;I would like to count the number of times per date per part that the percentage #good/#done is below 85%, and do this in a measure.&lt;/P&gt;&lt;P&gt;E.g. - 1 jan 2024 for part X: (55+55)/(60+70) = 84,6%&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- 2 jan 2024 for part X:&amp;nbsp;(55+55)/(55+75) = 84,6%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- 3 jan 2024 for part X:&amp;nbsp;(55+55)/(60+60) = 91,7%&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;Eventually I would like to count the number of times per month that this happens, and also be able to show exactly on which day this happened. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan 2024&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb 2024&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;March 2024&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if I then want to show it per day for january for example (and then only show these two rows):&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Day&lt;/TD&gt;&lt;TD&gt;Number&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1 jan 2024&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2 jan 2024&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope anybody can help me :).&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 14:22:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3779775#M147687</guid>
      <dc:creator>crl_91</dc:creator>
      <dc:date>2024-03-20T14:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of times something happens in measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3779789#M147689</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479494" data-lia-user-login="crl_91" class="lia-mention lia-mention-user"&gt;crl_91&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
  VAR __Table = 
    ADDCOLUMNS(
      SUMMARIZE('Table', [Date], [Part], "__good", SUM('Table'[# good]), "__done", SUM('Table'[# done]),
      "__PercentGood", DIVIDE( __good, __done, 0 )
    )
  VAR __Result = COUNTROWS( FILTER( __Table, [__PercentGood] &amp;lt; .85 )
RETURN
  __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Mar 2024 14:27:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3779789#M147689</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-03-20T14:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of times something happens in measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3793133#M148230</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479494" data-lia-user-login="crl_91" class="lia-mention lia-mention-user"&gt;crl_91&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create a table as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then I create a measure named Percentage. Here is the DAX code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Percentage =
VAR _currentDate =
    MAX ( 'Table'[Date] )
VAR _currentPart =
    MAX ( 'Table'[Part] )
VAR _SumGood =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Date] = _currentDate
                &amp;amp;&amp;amp; 'Table'[Part] = _currentPart
        ),
        'Table'[#good]
    )
VAR _SumDone =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Date] = _currentDate
                &amp;amp;&amp;amp; 'Table'[Part] = _currentPart
        ),
        'Table'[#done]
    )
RETURN
    _SumGood / _SumDone&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I create a measure to satisfy your requirements.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR _VirtualTbale =
    SUMMARIZE (
        'Table',
        'Table'[Date],
        'Table'[Part],
        "_percentage", 'Table'[Percentage]
    )
RETURN
    COUNTX ( FILTER ( _VirtualTbale, 'Table'[Percentage] &amp;lt; 0.85 ), [_percentage] )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 07:08:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3793133#M148230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-27T07:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of times something happens in measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3794381#M148273</link>
      <description>&lt;P&gt;It works perfectly :). Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 13:46:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3794381#M148273</guid>
      <dc:creator>crl_91</dc:creator>
      <dc:date>2024-03-27T13:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of times something happens in measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3841463#M150175</link>
      <description>&lt;P&gt;Hi Yilong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help! However, I needed to add more information to the measure, and now I am stuck again. Could you maybe help me with this one:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/td-p/3820146" target="_blank"&gt;Count number of times something happens in measure - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 12:24:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-times-something-happens-in-measure/m-p/3841463#M150175</guid>
      <dc:creator>crl_91</dc:creator>
      <dc:date>2024-04-16T12:24:31Z</dc:date>
    </item>
  </channel>
</rss>

