<?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: Transformation with the help of SQL query in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Transformation-with-the-help-of-SQL-query/m-p/1589256#M17420</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can only implement these step by step, there are different methods, a short guide:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Group by in the Query Editor&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Inner Join&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Create a Distinct table when&amp;nbsp;&lt;SPAN&gt;A.name='S75000001749', for example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Table&amp;nbsp; = CALCULATETABLE(DISTINCT('Tablename'[Columnname]),FILTER('Tablename',[A.name]='S75000001749'))&lt;BR /&gt;&lt;BR /&gt;4. For the conditional&amp;nbsp;sum expression, you can create a column using DAX with&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/if-function-dax" target="_blank"&gt;IF function&amp;nbsp;&lt;/A&gt;also there is a &lt;A href="https://docs.microsoft.com/en-us/dax/replace-function-dax" target="_blank"&gt;REPLACE function.&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&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;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 11 Jan 2021 05:45:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-01-11T05:45:58Z</dc:date>
    <item>
      <title>Transformation with the help of SQL query</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Transformation-with-the-help-of-SQL-query/m-p/1586121#M17389</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a small problem with PBI.&amp;nbsp; I have 2&amp;nbsp; tables namely 'Salesforcemerge' which contains Subscriber Number, Term Start Date, TermEnd Date, etc, and 'UsageFullAgg '&amp;nbsp; which contains Subscriber Number (with duplicate values) , Ordered Date, Value as shown in the picture. I want to merge them in a single file so that I can get aggregate values of Value Column present in&amp;nbsp;'UsageFullAgg ' table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample sql query is something like this:&lt;/P&gt;&lt;DIV&gt;select&lt;BR /&gt;A.VERSION,A.NAME,A.NAME_ACCOUNT,A.TERMSTARTDATE,A.TERMENDDATE,A.STATUS,A.BUSINESSSUBSCRIPTIONNUMBER__C,A.MASTERBUSINESSSUBSCRIPTIONNUMBER__C ,&lt;BR /&gt;SUM( CASE WHEN b.ORDERED_DATE&amp;gt; REPLACE(A.TERMSTARTDATE,'-','') AND B.ORDERED_DATE&amp;lt;REPLACE(A.TERMENDDATE,'-','') THEN SUM_VALUE ELSE 0 END ) HISTORICAL_VALUE&lt;BR /&gt;from (&lt;BR /&gt;SELECT DISTINCT A.VERSION,A.NAME,A.NAME_ACCOUNT,A.TERMSTARTDATE,A.TERMENDDATE,A.STATUS,A.BUSINESSSUBSCRIPTIONNUMBER__C,A.MASTERBUSINESSSUBSCRIPTIONNUMBER__C FROM zuora_processed A&lt;BR /&gt;where A.name='S75000001749'&lt;BR /&gt;) a&lt;BR /&gt;inner join usage_full_agg b on b.SUBSCRIBER_NUMBER=a.BUSINESSSUBSCRIPTIONNUMBER__C and statut='H' --and b.subscriber_number='845000259'&lt;BR /&gt;GROUP BY A.VERSION,A.NAME,A.NAME_ACCOUNT,A.TERMSTARTDATE,A.TERMENDDATE,A.STATUS,A.BUSINESSSUBSCRIPTIONNUMBER__C,A.MASTERBUSINESSSUBSCRIPTIONNUMBER__C&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone tell me how can I implement the same rule in Power BI?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 10:11:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Transformation-with-the-help-of-SQL-query/m-p/1586121#M17389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T10:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Transformation with the help of SQL query</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Transformation-with-the-help-of-SQL-query/m-p/1589256#M17420</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can only implement these step by step, there are different methods, a short guide:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Group by in the Query Editor&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Inner Join&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Create a Distinct table when&amp;nbsp;&lt;SPAN&gt;A.name='S75000001749', for example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Table&amp;nbsp; = CALCULATETABLE(DISTINCT('Tablename'[Columnname]),FILTER('Tablename',[A.name]='S75000001749'))&lt;BR /&gt;&lt;BR /&gt;4. For the conditional&amp;nbsp;sum expression, you can create a column using DAX with&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/if-function-dax" target="_blank"&gt;IF function&amp;nbsp;&lt;/A&gt;also there is a &lt;A href="https://docs.microsoft.com/en-us/dax/replace-function-dax" target="_blank"&gt;REPLACE function.&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&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;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Jan 2021 05:45:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Transformation-with-the-help-of-SQL-query/m-p/1589256#M17420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-11T05:45:58Z</dc:date>
    </item>
  </channel>
</rss>

