<?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: Create measure to count instances of a value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2113620#M48395</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266976" data-lia-user-login="JJH_" class="lia-mention lia-mention-user"&gt;JJH_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're on the right lines having a measure to count the number of rides rather than having separate tables holding the results.&amp;nbsp; However, the measure doesn't need to be as specific as&amp;nbsp;&lt;SPAN&gt;'Count # of Rides from Start Location',&amp;nbsp;'Count # of Rides from To Location' etc.&amp;nbsp; You can have a single 'Count # of Rides' measure, then it's the column(s) you use in your visual that determines how that's split.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count # of Rides = COUNTROWS('Trip Data')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 10:59:56 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2021-10-04T10:59:56Z</dc:date>
    <item>
      <title>Create measure to count instances of a value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112513#M48353</link>
      <description>&lt;P&gt;I am working with a bicycle trip table called 'Appended 2019-2021 Trip Data', which contains all information I need for analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to create aggregated measures to count instances of specific values of specific columns.&lt;/P&gt;&lt;P&gt;I wasn't sure how to do this as a calculated measure, and ended up with multiple tables to group by values (e.g. Count Start Day of Week, Count # of Rides from Start Location, etc.).&lt;/P&gt;&lt;P&gt;This approach doesn't make sense when trying to incorporate the counted values in a dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the 'Count # of Rides from Start Location' as an example, how can I create a calculated measure to count instances of # of rides started from each unique specified location? (there are 400+ unique starting locations)&lt;/P&gt;&lt;P&gt;Initial thoughts are to use calculate - count - filter on 'from_station_name' but am not sure how to write the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggregated table values that I'm looking to store in a calculated measure:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2021 15:45:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112513#M48353</guid>
      <dc:creator>JJH_</dc:creator>
      <dc:date>2021-10-03T15:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create measure to count instances of a value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112527#M48354</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266976" data-lia-user-login="JJH_" class="lia-mention lia-mention-user"&gt;JJH_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measue:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Count = COUNT('Trip Data'[from_station_name])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Or this one:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Count by filter = VAR _FSN = MAX ( 'Trip Data'[from_station_name] ) RETURN CALCULATE ( COUNTROWS ( 'Trip Data' ), FILTER ( 'Trip Data', 'Trip Data'[from_station_name] = _FSN ) )&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps, please consider&amp;nbsp;accepting&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2021 16:28:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112527#M48354</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-03T16:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create measure to count instances of a value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112560#M48355</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count = COUNT('Trip Data'[from_station_name]) --&amp;gt;counts # of all unique 'from_station_name', which is 588.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count by filter = VAR _FSN = MAX ( 'Trip Data'[from_station_name] ) RETURN CALCULATE ( COUNTROWS ( 'Trip Data' ), FILTER ( 'Trip Data', 'Trip Data'[from_station_name] = _FSN ) )&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is resulting in an output of 3, which doesn't seem to make sense?&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2021 18:16:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2112560#M48355</guid>
      <dc:creator>JJH_</dc:creator>
      <dc:date>2021-10-03T18:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create measure to count instances of a value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2113395#M48381</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266976" data-lia-user-login="JJH_" class="lia-mention lia-mention-user"&gt;JJH_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add from_Station_Name to your table then you can find the result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 09:36:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2113395#M48381</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-04T09:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create measure to count instances of a value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2113620#M48395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266976" data-lia-user-login="JJH_" class="lia-mention lia-mention-user"&gt;JJH_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're on the right lines having a measure to count the number of rides rather than having separate tables holding the results.&amp;nbsp; However, the measure doesn't need to be as specific as&amp;nbsp;&lt;SPAN&gt;'Count # of Rides from Start Location',&amp;nbsp;'Count # of Rides from To Location' etc.&amp;nbsp; You can have a single 'Count # of Rides' measure, then it's the column(s) you use in your visual that determines how that's split.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count # of Rides = COUNTROWS('Trip Data')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 10:59:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-measure-to-count-instances-of-a-value/m-p/2113620#M48395</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-10-04T10:59:56Z</dc:date>
    </item>
  </channel>
</rss>

