<?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: Column value from row in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895573#M151815</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can simply group by Response ID and use if statement in the aggregation.&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2024 13:31:33 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2024-05-06T13:31:33Z</dc:date>
    <item>
      <title>Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890202#M151721</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;H2&gt;&lt;SPAN&gt;We have training data that looks like below:&lt;/SPAN&gt;&lt;/H2&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Role&lt;/TD&gt;&lt;TD&gt;ResponseID&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Trainer&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Trainee&lt;/TD&gt;&lt;TD&gt;7125417&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Z&lt;/FONT&gt;&lt;/TD&gt;&lt;/T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&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A Trainee can complete several different training events either with a different Trainer each time or the same trainer over multiple times. Each time a Trainee compelete a training, the training event is stored as a transaction in the database by "ResponseID"; these increment up 1 for each training event, so it can be used to order things chronologically 1-N, where item 1 was completed before item 2, etc.&amp;nbsp;The trainer and trainee are logged to the same "ResponseID" and differentiated by the "Role" column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to have the data as depicted above in the "Trainer" column. So essentially, I want to have a single row of each "ResponseID" by making the "Trainer" a column instead of keeping it as "second" row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;I'm pretty new to Power BI and I'm just at a loss for how to even accomplish this. Any help or guidance with this is greatly appreciated!!&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 May 2024 23:07:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890202#M151721</guid>
      <dc:creator>deaconb</dc:creator>
      <dc:date>2024-05-03T23:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890273#M151726</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways to achive your required output, and one example is as shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach an example pbix file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 03:20:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890273#M151726</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-05-04T03:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890285#M151727</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hope this is what you're looking for&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Table 2 = 
SUMMARIZE ( 
    'Table',
    'Table'[ResponseID],
    "Trainee", MAXX ( FILTER ( 'Table', 'Table'[Role] = "Trainee" ), 'Table'[Name] ),
    "Trainer", MAXX ( FILTER ( 'Table', 'Table'[Role] = "Trainer" ), 'Table'[Name] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 May 2024 03:34:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3890285#M151727</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-04T03:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3891721#M151745</link>
      <description>&lt;P&gt;hey - this result is exactly what I'm looking for. However, when I insert it into my query as a column, it gives me an error of a cyclic reference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 00:40:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3891721#M151745</guid>
      <dc:creator>deaconb</dc:creator>
      <dc:date>2024-05-05T00:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3892086#M151755</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your query?&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 11:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3892086#M151755</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-05T11:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3894652#M151790</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp; for thier methods.&lt;BR /&gt;Here's how I solved it&lt;BR /&gt;Create column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Trainer = 
VAR _result = 
CALCULATE(
    MAX('Table'[Name]),
    FILTER(
        ALLEXCEPT(
            'Table',
            'Table'[ResponseID]
        ),
        'Table'[Role] = "Trainer"
    )
)
RETURN
IF(
    'Table'[Role] = "Trainee",
    _result,
    BLANK()
)&lt;/LI-CODE&gt;
&lt;P&gt;Create a calculated table&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result = 
SELECTCOLUMNS(
    FILTER('Table','Table'[Trainer] &amp;lt;&amp;gt; BLANK()),
    "ResponseID",'Table'[ResponseID],
    "Trainee",'Table'[Name],
    "Trainer",'Table'[Trainer]
)&lt;/LI-CODE&gt;
&lt;P&gt;Final output&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Albert He&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 09:45:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3894652#M151790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-06T09:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895412#M151808</link>
      <description>&lt;P&gt;The source data is a full dataset of training information. I truncated the data in my example to only the columns I care about/need to work with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I applied your logic as a Custom Column step in Power Query, I received this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression.Error: A cyclic reference was encountered during evaluation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I applied your logic as a new Column in Power BI table view, I received this error:&lt;/P&gt;&lt;P&gt;The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895412#M151808</guid>
      <dc:creator>deaconb</dc:creator>
      <dc:date>2024-05-06T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895525#M151810</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;this works as&amp;nbsp;a new Column in Power BI table view, but it isn't working as a&amp;nbsp;Custom Column step in Power Query (I understand they are different).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd prefer to do this in Power Query so I can then delete the "Trainer" row all togther, after the new column is created, which makes the remaining dataset 50% less rows as the only difference between the raw dataset rows is the Trainer row and Trainee row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know what modifications I'd need to make to get this to work through Power Query?&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:21:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895525#M151810</guid>
      <dc:creator>deaconb</dc:creator>
      <dc:date>2024-05-06T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895573#M151815</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can simply group by Response ID and use if statement in the aggregation.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:31:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895573#M151815</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-06T13:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895664#M151819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="144415" data-lia-user-login="deaconb" class="lia-mention lia-mention-user"&gt;deaconb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have your required output in dax formula from multiple people, but if you want to use Power Query instead, you can create a table like below using Power Query Ribbon clicking technique.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:54:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3895664#M151819</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-05-06T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Column value from row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3896073#M151834</link>
      <description>&lt;P&gt;Thanks. I'll just use the dax output.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 16:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Column-value-from-row/m-p/3896073#M151834</guid>
      <dc:creator>deaconb</dc:creator>
      <dc:date>2024-05-06T16:51:30Z</dc:date>
    </item>
  </channel>
</rss>

