<?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 Measure to count a category by month (+ criteria) to visualize in a line chart - not break line in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-a-category-by-month-criteria-to-visualize-in-a/m-p/3267818#M157266</link>
    <description>&lt;P&gt;How can I create a DAX measure to display the count of approved orders by month?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The filter is Activity Type = “EME” and Decision Code = “Approve”&lt;BR /&gt;The legend is by Business Unit (which is in a related table).&lt;/LI&gt;&lt;LI&gt;The measure only counts for the month range of 12 months prior to the date in the slicer which is in an related table ''Date_Workflow Approvals'[Date]&lt;/LI&gt;&lt;LI&gt;Month’s with no count should have +0 so the chart doesn't show broken lines&lt;/LI&gt;&lt;LI&gt;Ideally any business unit with no count in the filtered date range should be excluded entirely but this is proving difficult and no longer a main priority.&lt;/LI&gt;&lt;LI&gt;The chart needs to have a filter enabled on Decision Code and Activity type so it can be passed via &amp;nbsp;drill through to a table showing the supporting data.&lt;BR /&gt;&lt;BR /&gt;Table: Workflow Approvals&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Table: Purchasing Location&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Date Table:&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;Unrelated slicer date table:&amp;nbsp;'Date_Workflow Approvals'&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;I think i'm close with the following:&lt;BR /&gt;&amp;nbsp;- but when i put on the chart filter for PO Activity type = "EME"&amp;nbsp; (for drill through to data), it breaks the lines&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Approval EME Count YTD = 
VAR EndMonth =
    MAX ( 'Date_Workflow Approvals'[Date] )
VAR StartMonth =
    EOMONTH ( EndMonth, -12 )
VAR SelectedMonth =
    MAX ( 'Workflow - All Approvals'[Month] )
RETURN
    IF (
        SelectedMonth &amp;gt;= StartMonth
            &amp;amp;&amp;amp; SelectedMonth &amp;lt;= EndMonth,
        CALCULATE (
            COUNT ( 'Workflow - All Approvals'[Order Number] ),
            'Workflow - All Approvals'[Decision Code] = "Approve",
            'Workflow - All Approvals'[PO Activity Type] = "EME",
            'Workflow - All Approvals'[Month] &amp;gt;= StartMonth
                &amp;amp;&amp;amp; 'Workflow - All Approvals'[Month] &amp;lt;= SelectedMonth
        ) + IF(ISBLANK(SelectedMonth) &amp;amp;&amp;amp; NOT ISBLANK(StartMonth), 0, 0),
        BLANK ()
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've spent hours going in circles with ChatGPT but getting nowhere..&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 06:39:05 GMT</pubDate>
    <dc:creator>joyc0025</dc:creator>
    <dc:date>2023-06-05T06:39:05Z</dc:date>
    <item>
      <title>Measure to count a category by month (+ criteria) to visualize in a line chart - not break line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-a-category-by-month-criteria-to-visualize-in-a/m-p/3267818#M157266</link>
      <description>&lt;P&gt;How can I create a DAX measure to display the count of approved orders by month?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The filter is Activity Type = “EME” and Decision Code = “Approve”&lt;BR /&gt;The legend is by Business Unit (which is in a related table).&lt;/LI&gt;&lt;LI&gt;The measure only counts for the month range of 12 months prior to the date in the slicer which is in an related table ''Date_Workflow Approvals'[Date]&lt;/LI&gt;&lt;LI&gt;Month’s with no count should have +0 so the chart doesn't show broken lines&lt;/LI&gt;&lt;LI&gt;Ideally any business unit with no count in the filtered date range should be excluded entirely but this is proving difficult and no longer a main priority.&lt;/LI&gt;&lt;LI&gt;The chart needs to have a filter enabled on Decision Code and Activity type so it can be passed via &amp;nbsp;drill through to a table showing the supporting data.&lt;BR /&gt;&lt;BR /&gt;Table: Workflow Approvals&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Table: Purchasing Location&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Date Table:&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;Unrelated slicer date table:&amp;nbsp;'Date_Workflow Approvals'&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;I think i'm close with the following:&lt;BR /&gt;&amp;nbsp;- but when i put on the chart filter for PO Activity type = "EME"&amp;nbsp; (for drill through to data), it breaks the lines&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Approval EME Count YTD = 
VAR EndMonth =
    MAX ( 'Date_Workflow Approvals'[Date] )
VAR StartMonth =
    EOMONTH ( EndMonth, -12 )
VAR SelectedMonth =
    MAX ( 'Workflow - All Approvals'[Month] )
RETURN
    IF (
        SelectedMonth &amp;gt;= StartMonth
            &amp;amp;&amp;amp; SelectedMonth &amp;lt;= EndMonth,
        CALCULATE (
            COUNT ( 'Workflow - All Approvals'[Order Number] ),
            'Workflow - All Approvals'[Decision Code] = "Approve",
            'Workflow - All Approvals'[PO Activity Type] = "EME",
            'Workflow - All Approvals'[Month] &amp;gt;= StartMonth
                &amp;amp;&amp;amp; 'Workflow - All Approvals'[Month] &amp;lt;= SelectedMonth
        ) + IF(ISBLANK(SelectedMonth) &amp;amp;&amp;amp; NOT ISBLANK(StartMonth), 0, 0),
        BLANK ()
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've spent hours going in circles with ChatGPT but getting nowhere..&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 06:39:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-a-category-by-month-criteria-to-visualize-in-a/m-p/3267818#M157266</guid>
      <dc:creator>joyc0025</dc:creator>
      <dc:date>2023-06-05T06:39:05Z</dc:date>
    </item>
  </channel>
</rss>

