<?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 - How to calculate maximum of daily unique count within current month using measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3373434#M126983</link>
    <description>&lt;P&gt;Yes simplicity is best, it is working! i keep thinking about the outside filter will not be able to apply, but IT WORKS!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2023 06:11:06 GMT</pubDate>
    <dc:creator>ltang6</dc:creator>
    <dc:date>2023-08-10T06:11:06Z</dc:date>
    <item>
      <title>DAX - How to calculate maximum of daily unique count within current month using measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3363385#M126456</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi all,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I want to use DAX to calculate a measure based on Powerbi Dataset. Since i need to publish it, i cannot include any calculated columns or tables.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The objective is to calculate the maximum unique user utilization in the current month.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The methodology is:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1. Restrict to latest month using 'Month' column, and to correct tenant. I only want 'test1'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;2. Count the unique number of user for each date -&amp;gt; daily utilization.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;3. Return the maximum daily utilization of this latest month.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The result of this measure will be displayed in a 'Card' visualization.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I would also want to apply extra filter from Visualization filter to restrict user department.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;For the data listed below, by applying the department filter to be only 'Group 1', i would expect the correct output to be 3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;'Group 1' cannot be hardcoded like 'test1' because it is subject to change.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;My sample data are like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Table 1 contains a list of user activity.&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;User&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Date&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Month&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Tenant&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:a@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;a@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:b@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;b@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:a@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;a@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:c@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;c@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:d@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;d@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:c@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;c@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;2-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:d@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;d@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;2-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;1-Aug-23&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;test2&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Table 2 contains the details information on each user.&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;User&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Department&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;a@gmail.com&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Group 1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:b@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;b@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Group 1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:c@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;c@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Group 2&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;A href="mailto:d@gmail.com" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;d@gmail.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Group 1&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The relationship between the two tables are already build by link the two User columns.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 09:30:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3363385#M126456</guid>
      <dc:creator>ltang6</dc:creator>
      <dc:date>2023-08-03T09:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - How to calculate maximum of daily unique count within current month using measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3367386#M126651</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="597967" data-lia-user-login="ltang6" class="lia-mention lia-mention-user"&gt;ltang6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try to create a measure with below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR cur_dpt =
    SELECTEDVALUE ( 'Table 2'[Department] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( 'Table 2'[User] ),
        FILTER ( ALL ( 'Table 2' ), [Department] = cur_dpt )
    )
VAR tmp1 =
    FILTER ( ALL ( 'Table 1' ), [User] IN tmp )
VAR tmp2 =
    SUMMARIZE ( tmp1, [Month], "Cnt", DISTINCTCOUNT ( 'Table 1'[User] ) )
RETURN
    SUMX ( tmp2, [Cnt] )
&lt;/LI-CODE&gt;
&lt;P&gt;Add a card visual with measure:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_Binbin Yu&lt;BR /&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 02:55:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3367386#M126651</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T02:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - How to calculate maximum of daily unique count within current month using measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3371553#M126880</link>
      <description>&lt;P&gt;Hello Binbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your reply.&lt;/P&gt;&lt;P&gt;I think what you suggest is exactly what i need. It's only that the actual database is quite large.&lt;/P&gt;&lt;P&gt;Up on trying the above DAX, i have got the error that the query size is too large.&lt;/P&gt;&lt;P&gt;Not sure if there's a way to solve this.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 05:44:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3371553#M126880</guid>
      <dc:creator>ltang6</dc:creator>
      <dc:date>2023-08-09T05:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - How to calculate maximum of daily unique count within current month using measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3371612#M126883</link>
      <description>&lt;P&gt;below is how to calculate max distinct count of users, and you can add filters to set current month and tenant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; MaxX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Values&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DISTINCTCOUNT (&lt;/SPAN&gt;&lt;SPAN&gt;'Table1&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;[user])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Aug 2023 06:31:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3371612#M126883</guid>
      <dc:creator>davidwyt</dc:creator>
      <dc:date>2023-08-09T06:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - How to calculate maximum of daily unique count within current month using measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3373434#M126983</link>
      <description>&lt;P&gt;Yes simplicity is best, it is working! i keep thinking about the outside filter will not be able to apply, but IT WORKS!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 06:11:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-How-to-calculate-maximum-of-daily-unique-count-within/m-p/3373434#M126983</guid>
      <dc:creator>ltang6</dc:creator>
      <dc:date>2023-08-10T06:11:06Z</dc:date>
    </item>
  </channel>
</rss>

