<?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: Adding in a calculated column - percentage in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056871#M105481</link>
    <description>&lt;P&gt;Another easy way, if you don't need it to be a calculated column and are ok with a measure (that can be shown as a column in a matrix) could just be to calculate the sum for each and then divide them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Percentage :=
DIVIDE(
    SUM([# Classes Changed]),
    SUM([# All Classes])
)&lt;/LI-CODE&gt;&lt;P&gt;It might depend on how your data is structured, but a possiblity.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 05:10:49 GMT</pubDate>
    <dc:creator>TomasAndersson</dc:creator>
    <dc:date>2023-02-02T05:10:49Z</dc:date>
    <item>
      <title>Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056757#M105468</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm fairly new to PowerBi and struggling with adding in calculated columns. I need to add a column (in the value field in this matrix table) that claculates the&amp;nbsp;&lt;SPAN&gt;percentage&amp;nbsp;of '#classes changes' against '#all classes'. So the first&amp;nbsp;row should equal 2.36% (462 classes changed out of a total of 19521 classes is 2.36%)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 03:30:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056757#M105468</guid>
      <dc:creator>Meme123</dc:creator>
      <dc:date>2023-02-02T03:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056766#M105470</link>
      <description>&lt;P&gt;Percentage%=DIVIDE([# Classes Canged],[# ALL classes],0)&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 03:41:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056766#M105470</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2023-02-02T03:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056773#M105471</link>
      <description>&lt;P&gt;I should have noted that '#Classes changed' and '#All classes' are from two different tables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 03:48:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056773#M105471</guid>
      <dc:creator>Meme123</dc:creator>
      <dc:date>2023-02-02T03:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056777#M105472</link>
      <description>&lt;P&gt;Sorry,&amp;nbsp;&lt;SPAN&gt;I should have noted that '#Classes changed' and '#All classes' are from two different tables.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 03:50:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056777#M105472</guid>
      <dc:creator>Meme123</dc:creator>
      <dc:date>2023-02-02T03:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056866#M105480</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;If # Classes Changed and # All Classes are from different tables you can use &lt;A href="https://dax.guide/lookupvalue/" target="_self"&gt;LOOKUPVALUE()&lt;/A&gt;&amp;nbsp;first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need some sort of common key for each class in your tables (called ClassKey below, change accordingly). This also assumes that you create the columns in your table with the All Classes (ACTable) value and not the table with Classes Changed (CC Table). You can do it the other way around, but need to switch up the DAX then.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then a calculated column should be able to look something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% changed =
VAR __CurrentClass = 
ACTable[ClassKey]

VAR __ClassesChanged = 
LOOKUPVALUE(CCTable['# Classes Changed'],CCTable[ClassKey], __CurrentClass)
VAR _

return

DIVIDE(
    __ClassesChanged,
    ACTable['# All Classes'])&lt;/LI-CODE&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 05:08:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056866#M105480</guid>
      <dc:creator>TomasAndersson</dc:creator>
      <dc:date>2023-02-02T05:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056871#M105481</link>
      <description>&lt;P&gt;Another easy way, if you don't need it to be a calculated column and are ok with a measure (that can be shown as a column in a matrix) could just be to calculate the sum for each and then divide them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Percentage :=
DIVIDE(
    SUM([# Classes Changed]),
    SUM([# All Classes])
)&lt;/LI-CODE&gt;&lt;P&gt;It might depend on how your data is structured, but a possiblity.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 05:10:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056871#M105481</guid>
      <dc:creator>TomasAndersson</dc:creator>
      <dc:date>2023-02-02T05:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding in a calculated column - percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056918#M105487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508370" data-lia-user-login="Meme123" class="lia-mention lia-mention-user"&gt;Meme123&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could create a measure as below and format it as percentage:-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Percentage_classes = DIVIDE(sum('table1'[# Classes Changed]),Sum('table2'[# ALL classes]),0)&lt;/LI-CODE&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;</description>
      <pubDate>Thu, 02 Feb 2023 05:35:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-in-a-calculated-column-percentage/m-p/3056918#M105487</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2023-02-02T05:35:53Z</dc:date>
    </item>
  </channel>
</rss>

