<?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: Percentage Positive by Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315315#M23077</link>
    <description>&lt;P&gt;Well, I'm assuming that measure "positive cases" is counting up something in the raw data based on some criteria that indicates that a case is positive. Make another measure that's basically the same except without that criteria, then another dividing one by the other&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2020 16:05:07 GMT</pubDate>
    <dc:creator>jthomson</dc:creator>
    <dc:date>2020-08-21T16:05:07Z</dc:date>
    <item>
      <title>Percentage Positive by Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315242#M23075</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a DAX measure that calculates the positiviy rate by date.&amp;nbsp; Positivity Rate=Positive Cases per day/Total Tests Performed per day&lt;/P&gt;&lt;P&gt;My table has the following headers:&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result 2 is where the data is located that I wish to describe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Draw date is the date I wish to use for the calculation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me write a DAX that I can use to count the number of tests performed in a day as well as the number of positive tests that were also reported in that day?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following relationship table formed:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:37:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315242#M23075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-21T15:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Positive by Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315315#M23077</link>
      <description>&lt;P&gt;Well, I'm assuming that measure "positive cases" is counting up something in the raw data based on some criteria that indicates that a case is positive. Make another measure that's basically the same except without that criteria, then another dividing one by the other&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 16:05:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315315#M23077</guid>
      <dc:creator>jthomson</dc:creator>
      <dc:date>2020-08-21T16:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Positive by Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315323#M23079</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Not very clear with model. &lt;/P&gt;
&lt;P&gt;You have to try like&lt;/P&gt;
&lt;P&gt;divide(calculate(countrows(RawData), filter(resultlist, resultlist[result] ="Positive")) ,calculate(countrows(RawData)))&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 16:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315323#M23079</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-21T16:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Positive by Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315327#M23080</link>
      <description>&lt;P&gt;For the total number of tests performed your measure should count the total rows of patients tested which would look something like this:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;[Total Tests] =&lt;BR /&gt;CALCULATE(DISTINCTCOUNT('Raw Data'[Patient ID]), FILTER('Raw Data', 'Raw Data'[Patient vs Non-Patient] = "Patient")&lt;BR /&gt;&lt;BR /&gt;This measure counts the unique number of patients ID's in your data, filtering to make sure they are a patient (assuming you want patients only).&lt;BR /&gt;&lt;BR /&gt;For positivity rate it would be something like this:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;[Positivity Rate] =&amp;nbsp;&lt;BR /&gt;VAR _positive = CALCULATE([Total Tests], FILTER('Raw Data', 'Raw Data'[Result 2] = "Positive")&lt;BR /&gt;VAR _result = DIVIDE(_postive, [Total Tests])&lt;BR /&gt;RETURN _result&lt;BR /&gt;&lt;BR /&gt;This measure uses variables to calculate the positivity rate. It uses the same measure for total tests but adds an additional filter to the data so that we only count the positive results. In this instance I'm using it as a variable but you can use the same formula for another measure to get the # of positive cases.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;These measures rely on the filter context of visuals. That means when you use the 'Date Table'[Date] column, it will give you the numbers for that specific date.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 16:15:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Positive-by-Date/m-p/1315327#M23080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-21T16:15:59Z</dc:date>
    </item>
  </channel>
</rss>

