<?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: Transaction Gaps in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2490903#M68575</link>
    <description>&lt;P&gt;You could create a measure like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max gap = 
var summaryTable = ADDCOLUMNS( SUMMARIZE( 'data', 'data'[Customer Name], 'data'[Product]),
"@val", [Transaction Gap])
return MAXX( summaryTable, [@val])&lt;/LI-CODE&gt;&lt;P&gt;You can do the same with AVERAGEX&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 12:46:52 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-05-03T12:46:52Z</dc:date>
    <item>
      <title>Transaction Gaps</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2490834#M68570</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help in creating below DAX.&lt;/P&gt;&lt;P&gt;We need to calculate the transaction gap between all transactions for each customer. T&lt;SPAN&gt;he maximum transactions gap is the longest a customer has gone between transactions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For this I have written below DAX, but the problem here is I am not able to find max and average value as its getting sum up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, transaction Gap should exculde weekends.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Transaction Gap = 
var current_date = SELECTEDVALUE(data[Invoice Date])
var previous_invoice_date = 
CALCULATE(
    MAX(data[Invoice Date]),
    FILTER(
        ALLEXCEPT(data,data[Customer Name],data[Product]),
        data[Invoice Date] &amp;lt; current_date
    )
)

var diff = 
CALCULATE(
    COUNTROWS('Date'),
    DATESBETWEEN('Date'[Date],previous_invoice_date,current_date),
    'Date'[IsWeekend] = FALSE(),
    ALL(data)
)

RETURN diff&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 May 2022 12:25:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2490834#M68570</guid>
      <dc:creator>apatwal</dc:creator>
      <dc:date>2022-05-03T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Gaps</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2490903#M68575</link>
      <description>&lt;P&gt;You could create a measure like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max gap = 
var summaryTable = ADDCOLUMNS( SUMMARIZE( 'data', 'data'[Customer Name], 'data'[Product]),
"@val", [Transaction Gap])
return MAXX( summaryTable, [@val])&lt;/LI-CODE&gt;&lt;P&gt;You can do the same with AVERAGEX&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 12:46:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2490903#M68575</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-05-03T12:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Gaps</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2491012#M68584</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For fun only, Excel worksheet formulas are powerful enough,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 13:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transaction-Gaps/m-p/2491012#M68584</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-05-03T13:28:42Z</dc:date>
    </item>
  </channel>
</rss>

