<?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: Calculated table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3694822#M143671</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389075" data-lia-user-login="ChiRomeu" class="lia-mention lia-mention-user"&gt;ChiRomeu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used power query for this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create a blank query, copy and paste the below code into the advanced editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlbSUTI0MjAwANIGhvpABBaM1QHLGgFFjUzQZI2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Amount = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Amount", type number}, {"Date", type date}}),
    //create a list of months
    Month = Table.AddColumn(#"Changed Type", "Month", each {1..12} ),
    //expand the months
    #"Expanded Month" = Table.ExpandListColumn(Month, "Month"),
    //create a date using year and month
    #"Added Custom" = Table.AddColumn(#"Expanded Month", "Date_", each #date([Year],[Month],01)),
    //transform to look like output
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Date_", type date}, {"Month", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Date_", "Date"}})
in
    #"Renamed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know if this works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 21:02:22 GMT</pubDate>
    <dc:creator>adudani</dc:creator>
    <dc:date>2024-02-12T21:02:22Z</dc:date>
    <item>
      <title>Calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3694790#M143670</link>
      <description>&lt;P&gt;Hello colleagues,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a following table which I want convert it to:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Could you please kindly help me to solve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Chi&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 20:39:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3694790#M143670</guid>
      <dc:creator>ChiRomeu</dc:creator>
      <dc:date>2024-02-12T20:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3694822#M143671</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389075" data-lia-user-login="ChiRomeu" class="lia-mention lia-mention-user"&gt;ChiRomeu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used power query for this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create a blank query, copy and paste the below code into the advanced editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlbSUTI0MjAwANIGhvpABBaM1QHLGgFFjUzQZI2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Amount = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Amount", type number}, {"Date", type date}}),
    //create a list of months
    Month = Table.AddColumn(#"Changed Type", "Month", each {1..12} ),
    //expand the months
    #"Expanded Month" = Table.ExpandListColumn(Month, "Month"),
    //create a date using year and month
    #"Added Custom" = Table.AddColumn(#"Expanded Month", "Date_", each #date([Year],[Month],01)),
    //transform to look like output
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Date_", type date}, {"Month", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Date_", "Date"}})
in
    #"Renamed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know if this works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 21:02:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3694822#M143671</guid>
      <dc:creator>adudani</dc:creator>
      <dc:date>2024-02-12T21:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3695780#M143725</link>
      <description>&lt;P&gt;Dear Avinash,&lt;/P&gt;&lt;P&gt;&amp;nbsp;It works a half until expanded column "month", but as you can see the picture above, i want to something like when expanded to month meanwhile divided by 12 for the amount column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chi&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 08:27:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3695780#M143725</guid>
      <dc:creator>ChiRomeu</dc:creator>
      <dc:date>2024-02-13T08:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3696445#M143750</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389075" data-lia-user-login="ChiRomeu" class="lia-mention lia-mention-user"&gt;ChiRomeu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Kindly add a column after the month lost step.&lt;/P&gt;
&lt;P&gt;Use [amount] / List.Count([Month] in the step and then expand the month list.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 13:13:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table/m-p/3696445#M143750</guid>
      <dc:creator>adudani</dc:creator>
      <dc:date>2024-02-13T13:13:06Z</dc:date>
    </item>
  </channel>
</rss>

