<?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 help in Fabric Data Warehouse in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112773#M5085</link>
    <description>&lt;P&gt;Hello Nono Chen, you have posted the exact same DAX code as I provided ( ? )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To my understanding, this is not supported as a query language in Fabrics' Data Warehouse. I need this in a query languange so that I'm able to make this transformation at the Data Warehouse-level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Ludvig&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 06:31:48 GMT</pubDate>
    <dc:creator>ludvigreck</dc:creator>
    <dc:date>2024-08-22T06:31:48Z</dc:date>
    <item>
      <title>Transformation help in Fabric Data Warehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4110579#M5054</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with "translating" this DAX code, so the transformation can happen at the data warehouse-level?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ludvig Reck&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 06:52:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4110579#M5054</guid>
      <dc:creator>ludvigreck</dc:creator>
      <dc:date>2024-08-21T06:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Transformation help in Fabric Data Warehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112311#M5081</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="792548" data-lia-user-login="ludvigreck" class="lia-mention lia-mention-user"&gt;ludvigreck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR star = SELECTEDVALUE('Table'[Appointment Time]) // Query the date/time of the current row.
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR DUR = SELECTEDVALUE('Table'[Duration]) // Query the Duration of the current row.
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR nextStar = 
    CALCULATE(
        MIN('Table'[Appointment Time]),
        ALLSELECTED('Table'),
        'Table'[Appointment Time] &amp;gt; star
    )                                    // Query the next date/time.
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR TimeDiff = DATEDIFF(star, nextStar, MINUTE) //Query star and nextstar minute difference
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR final = 
    IF(
        TimeDiff &amp;lt; DUR,
        TimeDiff, 
        DUR
    ) 
// If timediff is less than the current duration, return timediff. Otherwise, duration is returned.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RETURN final //Return the final result.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 02:06:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112311#M5081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-22T02:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transformation help in Fabric Data Warehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112773#M5085</link>
      <description>&lt;P&gt;Hello Nono Chen, you have posted the exact same DAX code as I provided ( ? )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To my understanding, this is not supported as a query language in Fabrics' Data Warehouse. I need this in a query languange so that I'm able to make this transformation at the Data Warehouse-level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Ludvig&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 06:31:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112773#M5085</guid>
      <dc:creator>ludvigreck</dc:creator>
      <dc:date>2024-08-22T06:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transformation help in Fabric Data Warehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112866#M5087</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="792548" data-lia-user-login="ludvigreck" class="lia-mention lia-mention-user"&gt;ludvigreck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I misunderstood your question, please let me try to help you again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Translating DAX code to SQL for data warehouse-level transformations involves converting the logic and functions used in DAX to their SQL equivalents.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WITH CTE AS (
    SELECT 
        [Appointment Time] AS minDate,
        Duration AS dur,
        LEAD([Appointment Time]) OVER (ORDER BY [Appointment Time]) AS nextStart
    FROM 
        Query
)
SELECT 
    minDate,
    dur,
    CASE 
        WHEN nextStart IS NOT NULL THEN DATEDIFF(MINUTE, minDate, nextStart)
        ELSE NULL
    END AS [Time Diff calc]
FROM 
    CTE
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This SQL query should help you achieve the same transformation at the data warehouse level.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 07:35:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Transformation-help-in-Fabric-Data-Warehouse/m-p/4112866#M5087</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-22T07:35:14Z</dc:date>
    </item>
  </channel>
</rss>

