<?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 Help with dax to calculate conditional statement by month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3077899#M107082</link>
    <description>&lt;P&gt;I have a problem getting the right formula in my report.&amp;nbsp; I only have two tables, the activity table then just a standard date table to slice time frames.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ActivityTable:&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;DateTable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Day&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Month&amp;amp;Year etc.&lt;/P&gt;&lt;P&gt;Amount&lt;/P&gt;&lt;P&gt;Flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The records are a list of days, an amount for that day, and a Y or N to indicate if it exceeded a threshhold.&amp;nbsp; Looks like this&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1-Jan&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jan&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3-Jan&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4-Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;750&lt;/TD&gt;&lt;TD&gt;y&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end result I am trying to build is to get to by month, what percentage of days exceed the threshold&lt;/P&gt;&lt;P&gt;so like this:&amp;nbsp; &amp;nbsp;And would need it to do this for each month as dates are added.&amp;nbsp; Basically count how many days within a month/year had activity, then calculate the percentage of those days that had "Y's" flag.&amp;nbsp; So in this example, January had for activity dates and the threshhold was 500, and only 1 of the 4 exceeded that (Y)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;25%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I could count # rows by filtering the table for Y but when I do that, it is not by month.&amp;nbsp; It it just the whole table count of Ys.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this?&amp;nbsp; Thanks very much.&amp;nbsp; New to dax and it is very confusing switching from tableau &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 14:31:30 GMT</pubDate>
    <dc:creator>jenniferhoward</dc:creator>
    <dc:date>2023-02-13T14:31:30Z</dc:date>
    <item>
      <title>Help with dax to calculate conditional statement by month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3077899#M107082</link>
      <description>&lt;P&gt;I have a problem getting the right formula in my report.&amp;nbsp; I only have two tables, the activity table then just a standard date table to slice time frames.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ActivityTable:&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;DateTable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Day&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Month&amp;amp;Year etc.&lt;/P&gt;&lt;P&gt;Amount&lt;/P&gt;&lt;P&gt;Flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The records are a list of days, an amount for that day, and a Y or N to indicate if it exceeded a threshhold.&amp;nbsp; Looks like this&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1-Jan&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2-Jan&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3-Jan&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4-Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;750&lt;/TD&gt;&lt;TD&gt;y&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end result I am trying to build is to get to by month, what percentage of days exceed the threshold&lt;/P&gt;&lt;P&gt;so like this:&amp;nbsp; &amp;nbsp;And would need it to do this for each month as dates are added.&amp;nbsp; Basically count how many days within a month/year had activity, then calculate the percentage of those days that had "Y's" flag.&amp;nbsp; So in this example, January had for activity dates and the threshhold was 500, and only 1 of the 4 exceeded that (Y)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;25%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I could count # rows by filtering the table for Y but when I do that, it is not by month.&amp;nbsp; It it just the whole table count of Ys.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this?&amp;nbsp; Thanks very much.&amp;nbsp; New to dax and it is very confusing switching from tableau &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 14:31:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3077899#M107082</guid>
      <dc:creator>jenniferhoward</dc:creator>
      <dc:date>2023-02-13T14:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dax to calculate conditional statement by month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3077933#M107084</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here is one way to do this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Dax:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure 41 = &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_true&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (28)'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Table (28)'&lt;/SPAN&gt;&lt;SPAN&gt;[bool]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"y"&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_true&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (28)'&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;End result:&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Feb 2023 14:42:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3077933#M107084</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2023-02-13T14:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dax to calculate conditional statement by month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3078043#M107100</link>
      <description>&lt;P&gt;You are amazing!&amp;nbsp; Thanks so much - this worked perfectly!!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 15:43:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dax-to-calculate-conditional-statement-by-month/m-p/3078043#M107100</guid>
      <dc:creator>jenniferhoward</dc:creator>
      <dc:date>2023-02-13T15:43:49Z</dc:date>
    </item>
  </channel>
</rss>

