<?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: Reprt builder expression for calculation based on distinct values in a column in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1842054#M19306</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/241986"&gt;@murali5431&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;A simple&amp;nbsp;measure should do:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(SUMMARIZE('Table',[Column A],'Table'[Column B]),[Column B])&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;And if there are always&amp;nbsp;2 repeated values, you can also use:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(DISTINCT('Table'[Column B]),[Column B])&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="V-pazhen-msft_0-1620973825658.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/514207i2D7843704356C2DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="V-pazhen-msft_0-1620973825658.png" alt="V-pazhen-msft_0-1620973825658.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Paul Zheng _ Community Support Team&lt;BR /&gt;If this post helps, please Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 14 May 2021 06:30:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-14T06:30:37Z</dc:date>
    <item>
      <title>Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1838712#M19288</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a power BI report builder which has duplicated rows (column A) as below. I need to calculate sum of column B based on unique values in column A. Please let me know the report builder expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Column A&lt;/TD&gt;&lt;TD&gt;Column B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartA&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartB&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartA&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartB&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartC&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PartC&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the expression which would calculate sum of PartA + PartB + PartC = 150+100+200 = 450&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to assist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Muralidhar&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 14:00:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1838712#M19288</guid>
      <dc:creator>murali5431</dc:creator>
      <dc:date>2021-05-12T14:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1839027#M19290</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;Does the values in ColumnB will always be exactly same for repeted ColumnA members. How you want the calculation to work if you have have PartA with 2 distinct values in ColumnB, 150 &amp;amp; 120. What you want to do in this scenrio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 15:47:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1839027#M19290</guid>
      <dc:creator>HashamNiaz</dc:creator>
      <dc:date>2021-05-12T15:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1840357#M19299</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/25452"&gt;@HashamNiaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Values in ColumnB will always be exactly same for repeted ColumnA members, so we can ignore the scenario of columnB having different values for a value in column A.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for checking!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Muralidhar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 08:57:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1840357#M19299</guid>
      <dc:creator>murali5431</dc:creator>
      <dc:date>2021-05-13T08:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1840761#M19301</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;I would solve this like below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Create a new table using DAX;&lt;/P&gt;&lt;P&gt;Go to Modelling Tab -&amp;gt; New Table, provide following DAX&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;NewTable = SUMMARIZE(Table, Table[ColumnA], Table[ColumnB])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Table is the name of your table, you can replace it with your table name in the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now create a measure to sum column B, use following DAX&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;NewSum = SUM(NewTable[ColumnB])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will solve your requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hasham&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 13:13:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1840761#M19301</guid>
      <dc:creator>HashamNiaz</dc:creator>
      <dc:date>2021-05-13T13:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1842054#M19306</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/241986"&gt;@murali5431&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;A simple&amp;nbsp;measure should do:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(SUMMARIZE('Table',[Column A],'Table'[Column B]),[Column B])&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;And if there are always&amp;nbsp;2 repeated values, you can also use:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(DISTINCT('Table'[Column B]),[Column B])&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="V-pazhen-msft_0-1620973825658.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/514207i2D7843704356C2DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="V-pazhen-msft_0-1620973825658.png" alt="V-pazhen-msft_0-1620973825658.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Paul Zheng _ Community Support Team&lt;BR /&gt;If this post helps, please Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 May 2021 06:30:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1842054#M19306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-14T06:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reprt builder expression for calculation based on distinct values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1842702#M19318</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;It did work when I tried it in the power BI desktop where I have built the dataset. But, when I import this measure to the report builder report to which dataset is connected, it just gives me the first row value. Can you let me know what needs to be tweaked?&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 11:23:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Reprt-builder-expression-for-calculation-based-on-distinct/m-p/1842702#M19318</guid>
      <dc:creator>murali5431</dc:creator>
      <dc:date>2021-05-14T11:23:37Z</dc:date>
    </item>
  </channel>
</rss>

