<?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: calculating current month sales for only those dealers on which activity performed in L3M in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177463#M187935</link>
    <description>&lt;P&gt;I am trying with this logic, but not getting correct results,some customers sales are skipped while calculation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;L3M Active Dealers Current Month Sales = VAR L3M_Dealer_List = CALCULATETABLE( VALUES(DATA1[Dealer ERP Code]), -- Last 3 completed months DATESINPERIOD( 'Calendar'[Date], EOMONTH(MAX('Calendar'[Date]), -1), -3, MONTH ), -- Activity condition DATA1[Activity Conducted At] = "dealer Counter", -- Valid dealer NOT(ISBLANK(DATA1[Dealer ERP Code])) ) RETURN CALCULATE( [TOTAL_SALE], -- Apply only those dealers TREATAS(L3M_Dealer_List, DATA1[Dealer ERP Code]) )&lt;/P&gt;</description>
    <pubDate>Mon, 04 May 2026 12:25:45 GMT</pubDate>
    <dc:creator>Alka735</dc:creator>
    <dc:date>2026-05-04T12:25:45Z</dc:date>
    <item>
      <title>calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177462#M187934</link>
      <description>&lt;P&gt;Hii All,&lt;/P&gt;&lt;P&gt;Hope you are doing well.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need help with a requirement:&lt;/STRONG&gt; we want to calculate current-month (or month-wise) sales only for those customers who had activity at their counter in the last 3 completed months.&lt;/P&gt;&lt;P&gt;For example, if April is the current month, only customers with activity between January and March should be considered, and their April sales should be included regardless of whether they had activity in April or not.&lt;/P&gt;&lt;P&gt;Please help me with this question.&lt;/P&gt;&lt;P&gt;I am sharing the sample dataset for 2 tables ,Activity and Sales,we need to consider the customers where activity conducted at "Dealer Counter"&lt;BR /&gt;and the final output will be 700(total sales)&lt;/P&gt;&lt;P&gt;Date Customer ID Sales Amount&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2026-04-02&lt;/TD&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-10&lt;/TD&gt;&lt;TD&gt;C002&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-12&lt;/TD&gt;&lt;TD&gt;C003&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-15&lt;/TD&gt;&lt;TD&gt;C004&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-18&lt;/TD&gt;&lt;TD&gt;C005&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-20&lt;/TD&gt;&lt;TD&gt;C006&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Date Customer ID Activity Conducted At&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2026-01-10&lt;/TD&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-02-15&lt;/TD&gt;&lt;TD&gt;C002&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-03-05&lt;/TD&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-03-20&lt;/TD&gt;&lt;TD&gt;C003&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-01-25&lt;/TD&gt;&lt;TD&gt;C004&lt;/TD&gt;&lt;TD&gt;other&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-02-10&lt;/TD&gt;&lt;TD&gt;C005&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026-04-05&lt;/TD&gt;&lt;TD&gt;C006&lt;/TD&gt;&lt;TD&gt;dealer Counter&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Customer ID April Sales&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C002&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C003&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C005&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 04 May 2026 12:23:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177462#M187934</guid>
      <dc:creator>Alka735</dc:creator>
      <dc:date>2026-05-04T12:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177463#M187935</link>
      <description>&lt;P&gt;I am trying with this logic, but not getting correct results,some customers sales are skipped while calculation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;L3M Active Dealers Current Month Sales = VAR L3M_Dealer_List = CALCULATETABLE( VALUES(DATA1[Dealer ERP Code]), -- Last 3 completed months DATESINPERIOD( 'Calendar'[Date], EOMONTH(MAX('Calendar'[Date]), -1), -3, MONTH ), -- Activity condition DATA1[Activity Conducted At] = "dealer Counter", -- Valid dealer NOT(ISBLANK(DATA1[Dealer ERP Code])) ) RETURN CALCULATE( [TOTAL_SALE], -- Apply only those dealers TREATAS(L3M_Dealer_List, DATA1[Dealer ERP Code]) )&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2026 12:25:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177463#M187935</guid>
      <dc:creator>Alka735</dc:creator>
      <dc:date>2026-05-04T12:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177668#M187941</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="566659" data-lia-user-login="Alka735" class="lia-mention lia-mention-user"&gt;Alka735&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You need to write a DAX to caluclate this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Sales_Last3M_ActiveCustomers :=&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;VAR _currentDate = MAX(Sales[Date])&lt;BR /&gt;VAR _fromDate = EOMONTH(_currentDate, -4) + 1&lt;BR /&gt;VAR _toDate&amp;nbsp;&amp;nbsp; = EOMONTH(_currentDate, -1)&lt;BR /&gt;VAR _customers =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATETABLE (&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES ( Activity[Customer ID] ),&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity[Activity Conducted At] = "dealer Counter",&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity[Date] &amp;gt;= _fromDate,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Activity[Date] &amp;lt;= _toDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM ( Sales[Sales Amount] ),&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales[Customer ID] IN _customers&lt;BR /&gt;&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2026 20:19:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177668#M187941</guid>
      <dc:creator>Murtaza_Ghafoor</dc:creator>
      <dc:date>2026-05-04T20:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177737#M187942</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="566659" data-lia-user-login="Alka735" class="lia-mention lia-mention-user"&gt;Alka735&lt;/a&gt;&amp;nbsp;Please try with this script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure the relationship between &lt;SPAN&gt;Activity&lt;/SPAN&gt; and &lt;SPAN&gt;Sales&lt;/SPAN&gt; tables is &lt;STRONG&gt;not&lt;/STRONG&gt; active (or use &lt;SPAN&gt;CROSSFILTER&lt;/SPAN&gt; if needed), because we want independent filtering.&lt;/LI&gt;&lt;LI&gt;Replace &lt;SPAN&gt;'Date'&lt;/SPAN&gt; with your actual Date table name if using version&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dealer Counter Current Month Sales = 

VAR CurrentDate = MAX ( 'Date'[Date] )   // Assuming you have a proper Date table
VAR CurrentMonthStart = STARTOFMONTH ( CurrentDate )
VAR Last3MonthsStart  = EDATE ( CurrentMonthStart, -3 )

VAR QualifyingCustomers = 
    CALCULATETABLE (
        VALUES ( Activity[ID] ),
        Activity[Activity Conducted At] = "dealer Counter",
        Activity[Date] &amp;gt;= Last3MonthsStart,
        Activity[Date] &amp;lt; CurrentMonthStart
    )

RETURN
    CALCULATE (
        SUM ( Sales[Sales Amount] ),
        Sales[ID] IN QualifyingCustomers,
        Sales[Date Customer] &amp;gt;= CurrentMonthStart,
        Sales[Date Customer] &amp;lt; EOMONTH(CurrentMonthStart, 0) + 1
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 00:33:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177737#M187942</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2026-05-05T00:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177790#M187944</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="566659" data-lia-user-login="Alka735" class="lia-mention lia-mention-user"&gt;Alka735&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try this&lt;/P&gt;&lt;P&gt;L3M Active Dealers Current Month Sales =&lt;/P&gt;&lt;P&gt;VAR LastVisibleDate = MAX('Calendar'[Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Prev3Months = DATESINPERIOD(&lt;/P&gt;&lt;P&gt;'Calendar'[Date],EOMONTH(LastVisibleDate, -1),-3,MONTH)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR DealerList = CALCULATETABLE(&lt;/P&gt;&lt;P&gt;DISTINCT('Activity'[Dealer ERP Code]),Prev3Months,&lt;/P&gt;&lt;P&gt;'Activity'[Activity Conducted At] = "dealer Counter")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE([TOTAL_SALE],TREATAS(DealerList, 'Sales'[Dealer ERP Code]))&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 04:32:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177790#M187944</guid>
      <dc:creator>krishnakanth240</dc:creator>
      <dc:date>2026-05-05T04:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177982#M187951</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="764617" data-lia-user-login="krishnakanth240" class="lia-mention lia-mention-user"&gt;krishnakanth240&lt;/a&gt;&amp;nbsp;,it's working fine.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 10:13:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5177982#M187951</guid>
      <dc:creator>Alka735</dc:creator>
      <dc:date>2026-05-05T10:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: calculating current month sales for only those dealers on which activity performed in L3M</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5178044#M187957</link>
      <description>&lt;P&gt;You are welcome &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="566659" data-lia-user-login="Alka735" class="lia-mention lia-mention-user"&gt;Alka735&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 12:29:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculating-current-month-sales-for-only-those-dealers-on-which/m-p/5178044#M187957</guid>
      <dc:creator>krishnakanth240</dc:creator>
      <dc:date>2026-05-05T12:29:49Z</dc:date>
    </item>
  </channel>
</rss>

