<?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: Converting SQL statement into DAX calculated table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3021798#M102866</link>
    <description>&lt;LI-CODE lang="markup"&gt;trying to figure out how to convert the below SQL statement into a calculated table in DAX&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please rethink your approach.&amp;nbsp; State the business problem you are trying to solve and we can advise how to do that in Power BI.&amp;nbsp; Trying to convert from one system to another is often unproductive.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2023 00:57:25 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-01-16T00:57:25Z</dc:date>
    <item>
      <title>Converting SQL statement into DAX calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3021159#M102793</link>
      <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Hi all,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I am fairly new to DAX (only few weeks in) and trying to figure out how to convert the below SQL statement into a calculated table in DAX:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;SELECT&lt;/SPAN&gt; qry_DMT_DATA.ID
&lt;SPAN class=""&gt;FROM&lt;/SPAN&gt;
(&lt;SPAN class=""&gt;SELECT&lt;/SPAN&gt; qry_DMT_DATA.[Establishment Name],qry_DMT_DATA.LRN ,&lt;SPAN class=""&gt;MAX&lt;/SPAN&gt;(qry_DMT_DATA.[Learning Actual &lt;SPAN class=""&gt;End&lt;/SPAN&gt; &lt;SPAN class=""&gt;Date&lt;/SPAN&gt;]) &lt;SPAN class=""&gt;AS&lt;/SPAN&gt; MaxAED
&lt;SPAN class=""&gt;FROM&lt;/SPAN&gt; qry_DMT_DATA
&lt;SPAN class=""&gt;WHERE&lt;/SPAN&gt; (qry_DMT_DATA.[Leaner completion status]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Withdrawn'&lt;/SPAN&gt; &lt;SPAN class=""&gt;OR&lt;/SPAN&gt;
qry_DMT_DATA.[Leaner completion status]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Temporarily withdrawn'&lt;/SPAN&gt;) &lt;SPAN class=""&gt;AND&lt;/SPAN&gt; qry_DMT_DATA.[Withdrawal reason]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Health Issues'&lt;/SPAN&gt;
&lt;SPAN class=""&gt;GROUP&lt;/SPAN&gt; &lt;SPAN class=""&gt;BY&lt;/SPAN&gt; [LRN],[Establishment Name]) &lt;SPAN class=""&gt;AS&lt;/SPAN&gt; qry_HealthIssues &lt;SPAN class=""&gt;INNER&lt;/SPAN&gt; &lt;SPAN class=""&gt;JOIN&lt;/SPAN&gt; qry_DMT_DATA &lt;SPAN class=""&gt;ON&lt;/SPAN&gt; qry_HealthIssues.[LRN]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;qry_DMT_DATA.LRN &lt;SPAN class=""&gt;AND&lt;/SPAN&gt; qry_HealthIssues.[Establishment Name]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;qry_DMT_DATA.[Establishment Name]
&lt;SPAN class=""&gt;WHERE&lt;/SPAN&gt; qry_DMT_DATA.[Leaner completion status]&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Continuing'&lt;/SPAN&gt;
&lt;SPAN class=""&gt;AND&lt;/SPAN&gt; qry_DMT_DATA.[Learning &lt;SPAN class=""&gt;Start&lt;/SPAN&gt; &lt;SPAN class=""&gt;Date&lt;/SPAN&gt;]&lt;SPAN class=""&gt;&amp;lt;=&lt;/SPAN&gt;MaxAED;

&lt;/PRE&gt;&lt;P&gt;I have managed to produce the subquery in DAX to return me the table of those withdrawn with their latest AED, but I am struggling to link it back to the main table to retrieve the ID for all those which are still continuing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know there must be a simple solution but somehow I have hit a wall and cannot figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Went through a lot of websites to help me work it out but to I am stuck and cannot move forward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be grateful if anyone can point me to the right direction how to create a calculated table in DAX using the above parameters.&lt;/P&gt;&lt;P&gt;One of the solutions is to do all this in the SQL database and simply pull the results into the Power BI but this is more of a learning project than simple solution seeking for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your time and effort.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 10:49:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3021159#M102793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-15T10:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQL statement into DAX calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3021798#M102866</link>
      <description>&lt;LI-CODE lang="markup"&gt;trying to figure out how to convert the below SQL statement into a calculated table in DAX&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please rethink your approach.&amp;nbsp; State the business problem you are trying to solve and we can advise how to do that in Power BI.&amp;nbsp; Trying to convert from one system to another is often unproductive.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 00:57:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3021798#M102866</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-01-16T00:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQL statement into DAX calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3022484#M102906</link>
      <description>&lt;P&gt;Thank you for your input.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will rethink this and repost a new example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not necessarily trying to convert solution from one system to another, it is just that I know how to do it in the SQL so thought that would allow user to see what I was trying to achieve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 07:45:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQL-statement-into-DAX-calculated-table/m-p/3022484#M102906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-16T07:45:32Z</dc:date>
    </item>
  </channel>
</rss>

