<?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: Counting the number of non-blank values in a column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265043#M21172</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32333" data-lia-user-login="nandukrishnavs" class="lia-mention lia-mention-user"&gt;nandukrishnavs&lt;/a&gt;&lt;/P&gt;&lt;P&gt;This gives me a value of 13 for Rayadu.&lt;/P&gt;&lt;P&gt;I think it is not taking into account the dismissal where the batsman was Dhoni and Rayudu got dismissed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help incorporate that in the count somehow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jul 2020 13:51:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-31T13:51:18Z</dc:date>
    <item>
      <title>Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264882#M21161</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I am working on a cricket dataset and need to calculate the number of times a player got dismissed in a particular year. This is required for building the player stats where I calculate the player wise number of runs, average and strike-rate.&amp;nbsp; However, the data is in the below form:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above shows only filtered rows for balls faced by Rayudu. He is the player dismissed 13 out of 14 times and there is another batsman who got dismissed (Watson) on one of the occassion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If i show the filtered view on the occasions when Rayudu got dismissed, we can see that on one of the occasions, the batsman facing is MS Dhoni. I am trying to understand how to create a measure which can calculate that Rayudu was dismissed 14 times in the current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;While making the visualisation i would be making a table where i will select a player, his total runs, strike rate and average. This number of time a player got dismissed will be used for calculation of the average i.e. total runs/ no of time dismissed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below expression:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;no_dismissed = CALCULATE(COUNT(deliveries[player_dismissed]),FILTER(ALL(deliveries[player_dismissed]),deliveries[player_dismissed]&amp;lt;&amp;gt; ""))&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But it returns the count of all the occassions when there was a dismissal when that player was batting i.e. the count of the rows in the first image. However, i would like to calculate the no of rows in the second image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 12:51:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264882#M21161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T12:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264934#M21163</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , did not get it completely , try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;no_dismissed = CALCULATE(COUNT(deliveries[player_dismissed]),FILTER(ALL(deliveries[player_dismissed])&lt;STRONG&gt;,not(isblank(deliveries[player_dismissed])&lt;/STRONG&gt;)))&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 13:12:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264934#M21163</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-31T13:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264935#M21164</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;no_dismissed =
VAR __player =
    SELECTEDVALUE ( deliveries[batsman] )
VAR __result =
    CALCULATE (
        COUNT ( deliveries[player_dismissed] ),
        FILTER (
            ALL ( deliveries[player_dismissed] ),
            deliveries[player_dismissed] = __player
        )
    )
RETURN
    __result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;BR /&gt;Appreciate with a kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 13:13:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1264935#M21164</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-07-31T13:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265032#M21170</link>
      <description>&lt;P&gt;This returns the number of bowls faced by that batsman somehow.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 13:45:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265032#M21170</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265043#M21172</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32333" data-lia-user-login="nandukrishnavs" class="lia-mention lia-mention-user"&gt;nandukrishnavs&lt;/a&gt;&lt;/P&gt;&lt;P&gt;This gives me a value of 13 for Rayadu.&lt;/P&gt;&lt;P&gt;I think it is not taking into account the dismissal where the batsman was Dhoni and Rayudu got dismissed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help incorporate that in the count somehow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 13:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265043#M21172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T13:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265118#M21175</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;no_dismissed =
VAR __player =
    SELECTEDVALUE ( deliveries[batsman] )
VAR __result =
    CALCULATE (
        COUNT ( deliveries[player_dismissed] ),
        FILTER ( ALL ( 'deliveries' ), deliveries[player_dismissed] = __player )
    )
RETURN
    __result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;BR /&gt;Appreciate with a kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265118#M21175</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-07-31T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265127#M21176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to have a seperate table for Players which is the dimension table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create the slicer from the Player's table and then follow the formula above. It should give you the value for AT Rayadu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Incase you need some inspirations on the design.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/IPL-Analysis-The-Criclytics/td-p/156504" target="_blank"&gt;https://community.powerbi.com/t5/Data-Stories-Gallery/IPL-Analysis-The-Criclytics/td-p/156504&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=ujPuXZT7F6o&amp;amp;feature=youtu.be" target="_blank"&gt;https://www.youtube.com/watch?v=ujPuXZT7F6o&amp;amp;feature=youtu.be&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265127#M21176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T14:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265133#M21177</link>
      <description>&lt;P&gt;This takes away my year filter and gives me the count of how many times Rayadu got dismissed over the entire period of 12 years I am analysing (IPL seasons).&lt;/P&gt;&lt;P&gt;Can you also tell me how to avoid that?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:24:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265133#M21177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T14:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265210#M21179</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of ALL() function, use ALLEXCEPT(). Then specify the Year column.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/allexcept-function-dax" target="_blank"&gt;https://docs.microsoft.com/en-us/dax/allexcept-function-dax&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:47:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1265210#M21179</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-07-31T14:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of non-blank values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1266124#M21210</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume you have a Date Table too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Incase not, you should try adding a Date Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a Date Table&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/mark-as-date-table/" target="_blank"&gt;https://www.sqlbi.com/articles/mark-as-date-table/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 08:03:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-the-number-of-non-blank-values-in-a-column/m-p/1266124#M21210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-01T08:03:32Z</dc:date>
    </item>
  </channel>
</rss>

