<?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 Counting only unique rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092085#M162392</link>
    <description>&lt;P&gt;Can this code be improved to count unique rows based on column A in MY_DATA table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE

VAR B = 

COUNTROWS (FILTER 
            (
               'MY_DATA',
               'MY_DATA'[start time] IN DATESBETWEEN(
                                       'My_DATA'[start time], 
                                        DATE(2024, 7, 1), DATE(2024, 7, 31)
                                      )
           )
)
     
EVALUATE

{{B}}&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 09 Aug 2024 15:08:44 GMT</pubDate>
    <dc:creator>stribor45</dc:creator>
    <dc:date>2024-08-09T15:08:44Z</dc:date>
    <item>
      <title>Counting only unique rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092085#M162392</link>
      <description>&lt;P&gt;Can this code be improved to count unique rows based on column A in MY_DATA table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE

VAR B = 

COUNTROWS (FILTER 
            (
               'MY_DATA',
               'MY_DATA'[start time] IN DATESBETWEEN(
                                       'My_DATA'[start time], 
                                        DATE(2024, 7, 1), DATE(2024, 7, 31)
                                      )
           )
)
     
EVALUATE

{{B}}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Aug 2024 15:08:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092085#M162392</guid>
      <dc:creator>stribor45</dc:creator>
      <dc:date>2024-08-09T15:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Counting only unique rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092184#M162396</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="534556" data-lia-user-login="stribor45" class="lia-mention lia-mention-user"&gt;stribor45&lt;/a&gt;&amp;nbsp;So like this?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEFINE

VAR B = 

COUNTROWS( DISTINCT( SELECTCOLUMNS(FILTER 
            (
               'MY_DATA',
               'MY_DATA'[start time] IN DATESBETWEEN(
                                       'My_DATA'[start time], 
                                        DATE(2024, 7, 1), DATE(2024, 7, 31)
                                      )
           ), "__Column", [A] ) )
)
     
EVALUATE

{{B}}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Aug 2024 15:52:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092184#M162396</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-09T15:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Counting only unique rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092808#M162422</link>
      <description>&lt;P&gt;&amp;nbsp;I need to adjust the code but I am confused as a distinct function only takes one column table as an argument.&amp;nbsp; This is the code&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
SELECTCOLUMNS (
                    FILTER (
                        'MY_DATA',
                        'MY_DATA'[start time]
                            IN DATESBETWEEN (
                                'MY_DATA'[start time],
                                DATE ( 2024, 5, 1 ),
                                DATE ( 2024, 5, 31 )
                            )
                    ),
                    "__Columns", [call duration],
                    "__Column", [id] 
)&lt;/LI-CODE&gt;&lt;P&gt;Code above produces this table as a result (see the image below). Is there a way to remove duplicates row based on the [id]? Resulting table in the image produces duplicates and I need to end up with only two rows.&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;</description>
      <pubDate>Sat, 10 Aug 2024 02:38:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4092808#M162422</guid>
      <dc:creator>stribor45</dc:creator>
      <dc:date>2024-08-10T02:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Counting only unique rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4093444#M162440</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="534556" data-lia-user-login="stribor45" class="lia-mention lia-mention-user"&gt;stribor45&lt;/a&gt;&amp;nbsp;DISTINCT has a table version as well:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/distinct-table-function-dax" target="_blank"&gt;DISTINCT (table) function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2024 20:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-only-unique-rows/m-p/4093444#M162440</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-10T20:58:31Z</dc:date>
    </item>
  </channel>
</rss>

