<?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: Complex formula to provide counts and accurate percentages in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complex-formula-to-provide-counts-and-accurate-percentages/m-p/1174600#M18241</link>
    <description>&lt;P&gt;You are describing two "dimension" tables (employees and certifications) but it seems you leave out the "fact" table (employee certifications) ?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 22:32:44 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-06-22T22:32:44Z</dc:date>
    <item>
      <title>Complex formula to provide counts and accurate percentages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complex-formula-to-provide-counts-and-accurate-percentages/m-p/1173692#M18204</link>
      <description>&lt;P&gt;Hi All-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on the intersection between two tables.&lt;/P&gt;&lt;P&gt;One table is a list of employees. There is one line per employee, there is a region column, and a status column (active or inactive).&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;The other table is a list of certifications. There is one line per certification, there is a platform column (i.e. scrum, c+), there is a name column (matching names on the other table), and a status column (active or inactive).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm trying to create essentially a pivot table. The columns across the top are the platforms, and each platform has a count and a percentage (percentage of employees in that region, not total). The rows are the regions. This should only reflect active employees by country (using the first table as a reference).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is the formula I'm using right now, but it's providing inaccurate percentages and I can't figure out why:&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Percentage Certifications New =&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// get distinct count of employees on certifications list witn only active employees&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var individuals = DISTINCTCOUNT('Certifications Active Only'[Name])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// get count of active employees on employee list&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var total = COUNTAX('GlobalTeam (2)',[Status]="Active")&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// get count of employees by country !!ONLY one of the two options!!&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// OPTION 1 var countryTotal = COUNT('GlobalTeam (2)'[Country])&lt;BR /&gt;// OPTION 2 var countryTotal = COUNT('Certifications Active Only'[Country])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// get percentage of certified employees in the country&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var percentage = ROUND(((individuals/countryTotal)*100),0)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;// return all values for auditing purposes. Once complete only percentage will be returned&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;return "percent"&amp;amp;percentage&amp;amp;"!total"&amp;amp;total&amp;amp;"!ind"&amp;amp;individuals&amp;amp;"!country"&amp;amp;countryTotal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 1 returns the same countryTotal for every single row, including the total row. This is not correct. Option 2 returns a count of every certification line relevant to the platform, where multiple lines can reflect a single individual. The 61 in the screenshot below is more rows than we have employees with BP certifications.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a small example screenshot of the table reflecting option 2, for help explaining it.&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't do a distinct count on the names in the certifications list, because then numberator and denominator will be the result of the same function so everything will be 100%. Please help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:03:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complex-formula-to-provide-counts-and-accurate-percentages/m-p/1173692#M18204</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Complex formula to provide counts and accurate percentages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complex-formula-to-provide-counts-and-accurate-percentages/m-p/1174600#M18241</link>
      <description>&lt;P&gt;You are describing two "dimension" tables (employees and certifications) but it seems you leave out the "fact" table (employee certifications) ?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 22:32:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Complex-formula-to-provide-counts-and-accurate-percentages/m-p/1174600#M18241</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-22T22:32:44Z</dc:date>
    </item>
  </channel>
</rss>

