<?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: The power bi does not calculate identities in different rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998563#M101136</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="491062" data-lia-user-login="hana123" class="lia-mention lia-mention-user"&gt;hana123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you may create a measure like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;PatientsWithMultiDisease = 
SUMX(
    VALUES(data[ID]),
    VAR _db =
    CALCULATE(COUNTROWS(data), data[IsDB]="Yes")
    VAR _hf =
    CALCULATE(COUNTROWS(data), data[IsHF]="Yes")
    VAR _ht =
    CALCULATE(COUNTROWS(data), data[IsHT]="Yes")
    RETURN
    IF(_db+_hf+_ht&amp;gt;1, 1, 0)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to expand your data sample:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and verified the measure with a card visual:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2023 12:46:50 GMT</pubDate>
    <dc:creator>FreemanZ</dc:creator>
    <dc:date>2023-01-03T12:46:50Z</dc:date>
    <item>
      <title>The power bi does not calculate identities in different rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998045#M101101</link>
      <description>&lt;P&gt;hi everyone&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the my table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; isDiagnosisDiabetes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;isDiagnosisHeartFailure&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;isDiagnosisHypertension&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Date&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/1/2022&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2/7/2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to Count any patient with more than one diseases&lt;/P&gt;&lt;P&gt;but power bi in this case will return 0 id&amp;nbsp;&lt;/P&gt;&lt;P&gt;when should return 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;becuse patient number 1 has Diabetes and hypertension (more than one diseases ) but becuse it happend in different dates (rows)&lt;/P&gt;&lt;P&gt;power bi will not count it !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i Solve this problem?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOU&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 08:38:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998045#M101101</guid>
      <dc:creator>hana123</dc:creator>
      <dc:date>2023-01-03T08:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: The power bi does not calculate identities in different rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998142#M101106</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="491062" data-lia-user-login="hana123" class="lia-mention lia-mention-user"&gt;hana123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See it all at work in the attached file.&lt;/P&gt;
&lt;P&gt;Best to unpivot the columns to get a more manageable table structure first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can create a measure for the number of patients:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MoreThan1DiseaseFlag = 
VAR aux_ =
    CALCULATE ( DISTINCTCOUNT ( Table1[Diagnosis] ), Table1[Result] = "Yes" ) &amp;gt; 1
RETURN
    IF ( aux_, 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;that uses this other measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NumPatientsWithMoreThan1Disease = 
SUMX ( DISTINCT ( Table1[ID] ), [MoreThan1DiseaseFlag] )&lt;/LI-CODE&gt;
&lt;P&gt;You can also use [MoreThan1DiseaseFlag] to show in a table visual the list of patients with more than one disease, by using the measure as a table visual and&amp;nbsp;selecting it to show when the value is 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 09:16:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998142#M101106</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2023-01-03T09:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: The power bi does not calculate identities in different rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998563#M101136</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="491062" data-lia-user-login="hana123" class="lia-mention lia-mention-user"&gt;hana123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you may create a measure like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;PatientsWithMultiDisease = 
SUMX(
    VALUES(data[ID]),
    VAR _db =
    CALCULATE(COUNTROWS(data), data[IsDB]="Yes")
    VAR _hf =
    CALCULATE(COUNTROWS(data), data[IsHF]="Yes")
    VAR _ht =
    CALCULATE(COUNTROWS(data), data[IsHT]="Yes")
    RETURN
    IF(_db+_hf+_ht&amp;gt;1, 1, 0)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to expand your data sample:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and verified the measure with a card visual:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 12:46:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-power-bi-does-not-calculate-identities-in-different-rows/m-p/2998563#M101136</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-01-03T12:46:50Z</dc:date>
    </item>
  </channel>
</rss>

