<?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: Dax Script in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/970813#M11599</link>
    <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi&amp;nbsp;&lt;FONT face="arial,helvetica,sans-serif"&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Could you please share sample dataset and expected output.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;pravin&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 12:26:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-12T12:26:23Z</dc:date>
    <item>
      <title>Dax Script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/970573#M11590</link>
      <description>&lt;DIV&gt;hello all,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;i'm wondering if someone can help m, being trying to make this measure since the last 1 week now&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;my client asked me to produce a dashboard displaying only the last message received&lt;/DIV&gt;&lt;DIV&gt;here is the scenario.&lt;/DIV&gt;&lt;DIV&gt;its a reservation system, users have id call PDL and eache PDL can have one or multiple message when booking an appointement.&lt;/DIV&gt;&lt;DIV&gt;types of message:&lt;/DIV&gt;&lt;DIV&gt;- Prise de rdv en succès&lt;/DIV&gt;&lt;DIV&gt;-proposition possible&lt;/DIV&gt;&lt;DIV&gt;pas de possibilité de rdv&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;etc..&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;now the mesure that i need to create is the count of all last message per max(hour).&lt;/DIV&gt;&lt;DIV&gt;i made the following script&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;test_mesure:=CALCULATE( DISTINCTCOUNT('ANALYSE PRV MESURES'[PDL]); LASTNONBLANK('ANALYSE PRV MESURES'[DATETIME];'ANALYSE PRV MESURES'[DATETIME])&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;and this is not working.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;someone has an idea on how to make it ?&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 09:39:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/970573#M11590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-12T09:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/970813#M11599</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi&amp;nbsp;&lt;FONT face="arial,helvetica,sans-serif"&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Could you please share sample dataset and expected output.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;pravin&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 12:26:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/970813#M11599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-12T12:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Script</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/4848260#M185023</link>
      <description>&lt;P&gt;Below is a robust measure that does exactly that. It also works when you put Message on rows in a visual. The measure always chooses the last message per PDL inside the latest hour without letting the Message filter change which row is last. Replace 'ANALYSE PRV MESURES' with your table name if needed, and replace [MESSAGE] with the real message column.&lt;/P&gt;
&lt;P data-start="749" data-end="777"&gt;Last messages in latest hour&lt;/P&gt;
&lt;P data-start="779" data-end="1867"&gt;LastMessagesLatestHour =&lt;BR /&gt;VAR lastTime =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('ANALYSE PRV MESURES'[DATETIME]);&lt;BR /&gt;ALLSELECTED('ANALYSE PRV MESURES')&lt;BR /&gt;)&lt;BR /&gt;VAR lastHourKey = INT(lastTime * 24)&lt;BR /&gt;VAR hourRowsNoTypeFilter =&lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('ANALYSE PRV MESURES');&lt;BR /&gt;INT('ANALYSE PRV MESURES'[DATETIME] * 24) = lastHourKey&lt;BR /&gt;);&lt;BR /&gt;REMOVEFILTERS('ANALYSE PRV MESURES'[MESSAGE])&lt;BR /&gt;)&lt;BR /&gt;VAR lastPerPDL =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;hourRowsNoTypeFilter;&lt;BR /&gt;'ANALYSE PRV MESURES'[PDL];&lt;BR /&gt;"LastTime"; MAX('ANALYSE PRV MESURES'[DATETIME])&lt;BR /&gt;)&lt;BR /&gt;VAR lastPerPDLJoinReady =&lt;BR /&gt;SELECTCOLUMNS(&lt;BR /&gt;lastPerPDL;&lt;BR /&gt;"PDL"; 'ANALYSE PRV MESURES'[PDL];&lt;BR /&gt;"DATETIME"; [LastTime]&lt;BR /&gt;)&lt;BR /&gt;VAR lastRows =&lt;BR /&gt;NATURALINNERJOIN(&lt;BR /&gt;hourRowsNoTypeFilter;&lt;BR /&gt;lastPerPDLJoinReady&lt;BR /&gt;)&lt;BR /&gt;VAR typeFilter = VALUES('ANALYSE PRV MESURES'[MESSAGE])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ISEMPTY(typeFilter);&lt;BR /&gt;COUNTROWS(lastRows);&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;lastRows;&lt;BR /&gt;'ANALYSE PRV MESURES'[MESSAGE] IN typeFilter&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P data-start="1869" data-end="2404"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2025 13:33:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Script/m-p/4848260#M185023</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2025-10-12T13:33:41Z</dc:date>
    </item>
  </channel>
</rss>

