<?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: Split multiple columns into rows using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3669197#M142291</link>
    <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2024 01:29:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-01-31T01:29:14Z</dc:date>
    <item>
      <title>Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3658985#M141778</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&amp;amp; other DAX experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;for your help earlier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query is,&lt;/P&gt;&lt;P&gt;The condition to split is there are multiple columns to be splitting into rows. I have done splitting from 'Raw Data' table into rows in Table A for column 'List of Students', as below image and I would like to do as per in Table A+ (add new calculated column for the Activity) where it has multiple values. E.g. John has multiple activities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate if anyone can help me to achieve from Table A to Table A+.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note: I have done using Power Query before, but due to performance issue I have to move to DAX instead&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;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 08:12:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3658985#M141778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-25T08:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3659043#M141785</link>
      <description>&lt;P&gt;Certainly! To achieve matching based on values in DAX, you can use relationships and create calculated columns or measures depending on your requirements. Assuming you have two tables, 'Achieved' and 'To Achieve', and they share a common column (let's say 'ID' for demonstration purposes), you can create relationships between them. Then, you can use DAX formulas to achieve matching.&lt;/P&gt;&lt;P&gt;Here's an example using calculated columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 3 ('To Achieve') =&lt;BR /&gt;VAR CurrentID = 'To Achieve'[ID]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('Achieved'[Value]),&lt;BR /&gt;'Achieved'[ID] = CurrentID&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This formula assumes that 'To Achieve' and 'Achieved' tables have a relationship based on the 'ID' column. It looks up the corresponding 'Value' from the 'Achieved' table for each row in the 'To Achieve' table.&lt;/P&gt;&lt;P&gt;If you need to create a measure instead, you can use similar logic within the CALCULATE function.&lt;/P&gt;&lt;P&gt;Remember to adjust the column and table names according to your actual data structure. If you have multiple columns to match on, you might need to adjust the formula accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 06:45:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3659043#M141785</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-25T06:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3659152#M141790</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;&amp;amp; thank you for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to achieve from table A to table A+ (add new calculated column named 'Activity Involved'.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 08:25:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3659152#M141790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-25T08:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3660028#M141816</link>
      <description>&lt;P&gt;Please explain in detail.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 11:04:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3660028#M141816</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-01-25T11:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3661048#M141870</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please check the below and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Expected result table = 
VAR _t =
    GENERATESERIES ( 1, 100, 1 )
VAR _pathitem =
    ADDCOLUMNS ( Data, "@path", SUBSTITUTE ( Data[List of Students], ",", "|" ) )
VAR _pathitemsinging =
    ADDCOLUMNS ( Data, "@pathsinging", SUBSTITUTE ( Data[Singing], ",", "|" ) )
VAR _pathitemdancing =
    ADDCOLUMNS ( Data, "@pathdancing", SUBSTITUTE ( Data[Dancing], ",", "|" ) )
VAR _generatetable =
    FILTER (
        GENERATE (
            _t,
            ADDCOLUMNS ( _pathitem, "@Students", PATHITEM ( [@path], [Value] ) )
        ),
        [@Students] &amp;lt;&amp;gt; BLANK ()
    )
VAR _generatesinging =
    SUMMARIZE (
        FILTER (
            GENERATE (
                _t,
                ADDCOLUMNS ( _pathitemsinging, "@sing", PATHITEM ( [@pathsinging], [Value] ) )
            ),
            [@sing] &amp;lt;&amp;gt; BLANK ()
        ),
        Data[ID],
        Data[Class Name],
        [@sing]
    )
VAR _generatedancing =
    SUMMARIZE (
        FILTER (
            GENERATE (
                _t,
                ADDCOLUMNS ( _pathitemdancing, "@dance", PATHITEM ( [@pathdancing], [Value] ) )
            ),
            [@dance] &amp;lt;&amp;gt; BLANK ()
        ),
        Data[ID],
        Data[Class Name],
        [@dance]
    )
RETURN
    SUMMARIZE (
        ADDCOLUMNS (
            _generatetable,
            "@activity",
                SWITCH (
                    TRUE (),
                    COUNTROWS (
                        FILTER (
                            _generatesinging,
                            Data[ID] = EARLIER ( Data[ID] )
                                &amp;amp;&amp;amp; Data[Class Name] = EARLIER ( Data[Class Name] )
                                &amp;amp;&amp;amp; [@Students] = [@sing]
                        )
                    ) &amp;gt;= 1 &amp;amp;&amp;amp; COUNTROWS (
                        FILTER (
                            _generatedancing,
                            Data[ID] = EARLIER ( Data[ID] )
                                &amp;amp;&amp;amp; Data[Class Name] = EARLIER ( Data[Class Name] )
                                &amp;amp;&amp;amp; [@Students] = [@dance]
                        )
                    ) &amp;gt;= 1, "Sing,Dance",
                    COUNTROWS (
                        FILTER (
                            _generatesinging,
                            Data[ID] = EARLIER ( Data[ID] )
                                &amp;amp;&amp;amp; Data[Class Name] = EARLIER ( Data[Class Name] )
                                &amp;amp;&amp;amp; [@Students] = [@sing]
                        )
                    ) &amp;gt;= 1, "Sing",
                    COUNTROWS (
                        FILTER (
                            _generatedancing,
                            Data[ID] = EARLIER ( Data[ID] )
                                &amp;amp;&amp;amp; Data[Class Name] = EARLIER ( Data[Class Name] )
                                &amp;amp;&amp;amp; [@Students] = [@dance]
                        )
                    ) &amp;gt;= 1, "Dance"
                )
        ),
        Data[ID],
        Data[Class Name],
        [@Students],
        [@activity]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Jan 2024 17:18:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3661048#M141870</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-01-25T17:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3662000#M141905</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;If these also don't help, please share more detailed information and description to help us clarify your scenario to test.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 05:08:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3662000#M141905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-26T05:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Split multiple columns into rows using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3669197#M142291</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 01:29:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Split-multiple-columns-into-rows-using-DAX/m-p/3669197#M142291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-31T01:29:14Z</dc:date>
    </item>
  </channel>
</rss>

