<?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 Dax Formula calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Formula-calculations/m-p/4085281#M162144</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I need some help please. My Dax measures counts are not working dependently to one another. i have done a male and female count, but it is only taking to account either male or either female and not giving me a total count. Its as if it has taken the first value in the source whereas I want the total value.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Herre are some of my Dax measures that I used:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;MaleCount =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Patients[Gender] = "Male",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FemaleCount =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Patients[Gender] = "Female",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Age = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; AVERAGE(Patients[Age]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Registered =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Therapy[Created On],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Therapy),Therapy[NHS/Hospital] = MAX(Therapy[NHS/Hospital])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2024 22:07:36 GMT</pubDate>
    <dc:creator>Polar_A</dc:creator>
    <dc:date>2024-08-06T22:07:36Z</dc:date>
    <item>
      <title>Dax Formula calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Formula-calculations/m-p/4085281#M162144</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I need some help please. My Dax measures counts are not working dependently to one another. i have done a male and female count, but it is only taking to account either male or either female and not giving me a total count. Its as if it has taken the first value in the source whereas I want the total value.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Herre are some of my Dax measures that I used:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;MaleCount =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Patients[Gender] = "Male",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FemaleCount =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Patients[Gender] = "Female",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Age = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; AVERAGE(Patients[Age]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Registered =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(Patients),Therapy[Created On],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Prescriptions),Prescriptions[Therapy] = MAX(Prescriptions[Therapy])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Therapy),Therapy[NHS/Hospital] = MAX(Therapy[NHS/Hospital])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(ALL(Patients),Patients[Referring Establishment] = MAX(Patients[Referring Establishment])))&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 22:07:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Formula-calculations/m-p/4085281#M162144</guid>
      <dc:creator>Polar_A</dc:creator>
      <dc:date>2024-08-06T22:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Formula calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Formula-calculations/m-p/4085480#M162151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="710490" data-lia-user-login="Polar_A" class="lia-mention lia-mention-user"&gt;Polar_A&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Base on your description, it seems like the total values of FemaleCount and MaleCount are incorrect. You can create &lt;STRONG&gt;another two&lt;/STRONG&gt; &lt;STRONG&gt;new&lt;/STRONG&gt; measures as below and &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;replace&lt;/STRONG&gt; &lt;/FONT&gt;the measure [&lt;SPAN&gt;MaleCount&lt;/SPAN&gt;] and [&lt;SPAN&gt;FemaleCount&lt;/SPAN&gt;] with these two new measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New_FemaleCount =
SUMX (
    VALUES ( Prescriptions[Therapy] ),
    SUMX ( VALUES ( Patients[Referring Establishment] ), [FemaleCount] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;New_MaleCount =
SUMX (
    VALUES ( Prescriptions[Therapy] ),
    SUMX ( VALUES ( Patients[Referring Establishment] ), [MaleCount] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you can refer the following links to try to solve your problem...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRii_6qkLNh8&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C04b502a00e394ebcbdbb08dbe678a199%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638357178043682606%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=F8Zoa%2FXFQ8QKHwdavEaOxTaUNz4NS9MqXACEo6FOVA0%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKa7Ds4EAjNQ&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C04b502a00e394ebcbdbb08dbe678a199%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638357178043688279%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=H5qNA3fPTJJ9IBbZjXKkwv73tfPlz7Zf9bFR2IjI5us%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;Dax for Power BI: Fixing Incorrect Measure Totals&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above ones can't help you figure out, please&amp;nbsp;&lt;SPAN&gt;provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your tables&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and your&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 01:38:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Formula-calculations/m-p/4085480#M162151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-07T01:38:22Z</dc:date>
    </item>
  </channel>
</rss>

