<?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 Pct based on Type in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Pct-based-on-Type/m-p/922134#M22216</link>
    <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help on the correct DAX formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have this source. I just need to get the percentage of colors based on the total count.&lt;/P&gt;&lt;P&gt;I have seen some of the formula here but that is for numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Blue&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Blue&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total is 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pct&lt;/P&gt;&lt;P&gt;Red&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50%&lt;/P&gt;&lt;P&gt;Blue&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20%&lt;/P&gt;&lt;P&gt;Green&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2020 07:37:07 GMT</pubDate>
    <dc:creator>ishzoulify</dc:creator>
    <dc:date>2020-02-05T07:37:07Z</dc:date>
    <item>
      <title>Pct based on Type</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Pct-based-on-Type/m-p/922134#M22216</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help on the correct DAX formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have this source. I just need to get the percentage of colors based on the total count.&lt;/P&gt;&lt;P&gt;I have seen some of the formula here but that is for numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Blue&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;Blue&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Green&lt;/P&gt;&lt;P&gt;Red&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total is 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pct&lt;/P&gt;&lt;P&gt;Red&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50%&lt;/P&gt;&lt;P&gt;Blue&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20%&lt;/P&gt;&lt;P&gt;Green&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 07:37:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Pct-based-on-Type/m-p/922134#M22216</guid>
      <dc:creator>ishzoulify</dc:creator>
      <dc:date>2020-02-05T07:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pct based on Type</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Pct-based-on-Type/m-p/922197#M22217</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/163190"&gt;@ishzoulify&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I've replicated your data into a table named Colours, which is how the following examples will be written for. You can do thi sin less steps, but this is how I would approach it, as I can re-use the measures later if I need to.&lt;/P&gt;&lt;P&gt;Create the following measures:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Colours = COUNTROWS(Colours)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;# Total Colours = CALCULATE(
    [# Colours],
    ALL(Colours[Type])
)&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;ALL&lt;/FONT&gt; removes the filter on &lt;FONT face="courier new,courier"&gt;Type&lt;/FONT&gt;, which means that for each row it will count everything.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% of Total = DIVIDE(
    [# Colours],
    [# Total Colours]
)&lt;/LI-CODE&gt;&lt;P&gt;This measure then gets formatted as a percentage.&lt;/P&gt;&lt;P&gt;Here's my results, with all measures shown for completeness:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 665px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/232235iA3CE2F0DE5C74A67/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://coacervo-my.sharepoint.com/:u:/g/personal/daniel_coacervo_co/ERVOR7RgNMNJiqSu3IXEvSEBAK59c8pYsOYGK3K9RdTpLA?e=6GVqTz" target="_self"&gt;Here's a copy of my workbook for your reference&lt;/A&gt;, in case you want to check anything.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="2"&gt;If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 08:25:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Pct-based-on-Type/m-p/922197#M22217</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2020-02-05T08:25:31Z</dc:date>
    </item>
  </channel>
</rss>

