<?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: traspose data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828044#M149675</link>
    <description>&lt;P&gt;Tom! first at all tks for your time!&lt;/P&gt;&lt;P&gt;Your suggestion workded fantastic, but, how is it updated when a line is added to table1, because when the data is refreshed (pbi is refreshed), the querey created with M is not updated. Do you understand my doubt?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 17:03:06 GMT</pubDate>
    <dc:creator>braulio</dc:creator>
    <dc:date>2024-04-10T17:03:06Z</dc:date>
    <item>
      <title>traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3827782#M149664</link>
      <description>&lt;P&gt;Hi, I don't know if it is posible or if I have to work my data in excel before importing it.&lt;/P&gt;&lt;P&gt;I have data in this format&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&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;and I need it in this way:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&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;&amp;nbsp;&lt;/P&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;&amp;nbsp;&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if it is posible to work with DAX or another way from pbi.&lt;/P&gt;&lt;P&gt;Tks for any ideas!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 14:16:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3827782#M149664</guid>
      <dc:creator>braulio</dc:creator>
      <dc:date>2024-04-10T14:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3827888#M149670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483981" data-lia-user-login="braulio" class="lia-mention lia-mention-user"&gt;braulio&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use Power Query for this.&lt;/P&gt;
&lt;P&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out &lt;A style="margin-right: 5px;" href="https://www.tackytech.blog/how-to-use-power-querys-advanced-editor/" rel="nofollow noopener noreferrer" target="_blank"&gt;this quick walkthrough&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUSpITSnKB9KJSDgJCSfDcaxOtJIRkJVVmphHtAZjICs3sSgzkWgdJiQ7ypQ0O2IB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, encuestador = _t, var1_1 = _t, var1_2 = _t, var1_3 = _t, var2_1 = _t, var2_2 = _t, var2_3 = _t, var3_1 = _t, var3_2 = _t, var3_3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"encuestador", type text}, {"var1_1", type text}, {"var1_2", type text}, {"var1_3", type text}, {"var2_1", type text}, {"var2_2", type text}, {"var2_3", type text}, {"var3_1", type text}, {"var3_2", type text}, {"var3_3", type text}}),
    #"Removed Other Columns 1" = Table.SelectColumns(#"Changed Type", {"id", "encuestador", "var1_1", "var1_2", "var1_3"}),
    #"Removed Other Columns 2" = Table.SelectColumns(#"Changed Type", {"id", "encuestador", "var2_1", "var2_2", "var2_3"}),
    #"Renamed Columns 2" = Table.RenameColumns(#"Removed Other Columns 2",{{"var2_1", "var1_1"}, {"var2_2", "var1_2"}, {"var2_3", "var1_3"}}),
    #"Removed Other Columns 3" = Table.SelectColumns(#"Changed Type", {"id", "encuestador", "var3_1", "var3_2", "var3_3"}),
    #"Renamed Columns 3" = Table.RenameColumns(#"Removed Other Columns 3",{{"var3_1", "var1_1"}, {"var3_2", "var1_2"}, {"var3_3", "var1_3"}}),
    #"Appended Query" = Table.Combine({#"Removed Other Columns 1", #"Renamed Columns 2", #"Renamed Columns 3"})
in
    #"Appended Query"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not super dynamic, but it might do the job for your case as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 15:01:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3827888#M149670</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-04-10T15:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828044#M149675</link>
      <description>&lt;P&gt;Tom! first at all tks for your time!&lt;/P&gt;&lt;P&gt;Your suggestion workded fantastic, but, how is it updated when a line is added to table1, because when the data is refreshed (pbi is refreshed), the querey created with M is not updated. Do you understand my doubt?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 17:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828044#M149675</guid>
      <dc:creator>braulio</dc:creator>
      <dc:date>2024-04-10T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828252#M149689</link>
      <description>&lt;P&gt;Tom, a&amp;nbsp;possible solution is to add the lines of the query that transposes after the query that imports the original data, without the first line obviously.&amp;nbsp;I have renamed the lines for more clarity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Excel.Workbook(File.Contents("C:\1\aTrasponer.xlsx"), null, true),
    Hoja1_Sheet = Source{[Item="Hoja1",Kind="Sheet"]}[Data],
    #"Promoted Headers1" = Table.PromoteHeaders(Hoja1_Sheet, [PromoteAllScalars=true]),
    #"primer bloque" = Table.SelectColumns(#"Promoted Headers1", {"id", "encuestador", "var1_1", "var1_2", "var1_3"}),
    #"segundo bloque" = Table.SelectColumns(#"Promoted Headers1", {"id", "encuestador", "var2_1", "var2_2", "var2_3"}),
    #"segundo bloque renomb" = Table.RenameColumns(#"segundo bloque",{{"var2_1", "var1_1"}, {"var2_2", "var1_2"}, {"var2_3", "var1_3"}}),
    #"tercer bloque" = Table.SelectColumns(#"Promoted Headers1", {"id", "encuestador", "var3_1", "var3_2", "var3_3"}),
    #"tercer bloque renomb" = Table.RenameColumns(#"tercer bloque",{{"var3_1", "var1_1"}, {"var3_2", "var1_2"}, {"var3_3", "var1_3"}}),
    #"acumulo 3 bloques" = Table.Combine({#"primer bloque", #"segundo bloque renomb", #"tercer bloque renomb"})
in
    #"acumulo 3 bloques"&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 20:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828252#M149689</guid>
      <dc:creator>braulio</dc:creator>
      <dc:date>2024-04-10T20:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828263#M149690</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483981" data-lia-user-login="braulio" class="lia-mention lia-mention-user"&gt;braulio&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a new row would be added, then the M code would still work and the semantic model would get refreshed accordingly. If you got 3 new columns on the right, then the M code would not work in the current design.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 19:22:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828263#M149690</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-04-10T19:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: traspose data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828441#M149704</link>
      <description>&lt;P&gt;Tom, it did not work for me, but using a single query did, so I solved the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 21:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/traspose-data/m-p/3828441#M149704</guid>
      <dc:creator>braulio</dc:creator>
      <dc:date>2024-04-10T21:22:26Z</dc:date>
    </item>
  </channel>
</rss>

