<?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: For all kinds in one column pick value in second column based on aggregation in third in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3660999#M141867</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;thank you for your reply. It does work as advertised as long as it's displayed along with the other values. Your solution did eventually help me along to my final implementation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For posterity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up adding a new calculated column in my original table (or at least imported from the source):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GreatestValue = 
MAXX(
    FILTER(
        'Table',
        'Table'[Type] = EARLIER('Table'[Type])),
    'Table'[Value]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I generated a new table in my data set:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table2 = 
SELECTCOLUMNS(
	CALCULATETABLE(
		Table,
		Table[Value] = Table[GreatestValue]
	),
	"Type", Table[Type],
	"Name", Table[Name],
	"Value", Table[Value]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this can be done more elegantly (and if someone is up for the challenge, please feel free), but it does allow me to manipulate the data as needed in my visualizations.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 16:59:30 GMT</pubDate>
    <dc:creator>sslezic</dc:creator>
    <dc:date>2024-01-25T16:59:30Z</dc:date>
    <item>
      <title>For all kinds in one column pick value in second column based on aggregation in third</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3655042#M141598</link>
      <description>&lt;P&gt;I apologize if this is an obvious solution and has been covered many times before. There is just so much noise when searching for a simple solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is a representative table for the data I have:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like: &lt;U&gt;for each Type get Name that has max Value&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in this case my result would be a table with two rows that have Name values Y and X in them. I don't care how much of the original rows I keep (I can always extract Names out of there).&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 20:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3655042#M141598</guid>
      <dc:creator>sslezic</dc:creator>
      <dc:date>2024-01-23T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: For all kinds in one column pick value in second column based on aggregation in third</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3655321#M141608</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270540" data-lia-user-login="sslezic" class="lia-mention lia-mention-user"&gt;sslezic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please follow these steps:&lt;/P&gt;
&lt;P&gt;1.Create a measure to get the name of the maximum value corresponding to each type.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;max_name =

VAR _max_value = MAXX(FILTER(ALL('Table'),'Table'[Type] = MAX('Table'[Type])),'Table'[Value])

RETURN

IF(MAX('Table'[Value]) = _max_value,

MAX('Table'[Name]),

BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;2.The result obtained is shown below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 01:43:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3655321#M141608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-24T01:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: For all kinds in one column pick value in second column based on aggregation in third</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3660999#M141867</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;thank you for your reply. It does work as advertised as long as it's displayed along with the other values. Your solution did eventually help me along to my final implementation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For posterity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up adding a new calculated column in my original table (or at least imported from the source):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GreatestValue = 
MAXX(
    FILTER(
        'Table',
        'Table'[Type] = EARLIER('Table'[Type])),
    'Table'[Value]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I generated a new table in my data set:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table2 = 
SELECTCOLUMNS(
	CALCULATETABLE(
		Table,
		Table[Value] = Table[GreatestValue]
	),
	"Type", Table[Type],
	"Name", Table[Name],
	"Value", Table[Value]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this can be done more elegantly (and if someone is up for the challenge, please feel free), but it does allow me to manipulate the data as needed in my visualizations.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 16:59:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3660999#M141867</guid>
      <dc:creator>sslezic</dc:creator>
      <dc:date>2024-01-25T16:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: For all kinds in one column pick value in second column based on aggregation in third</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3661247#M141878</link>
      <description>&lt;P&gt;It seems I was premature in my celebration. As much as my previous solution worked in Desktop Power BI, I could not upload it to the service as the data behind my calculation table is a DirectQuery source from another Power BI dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final solution that did work was a new column on my DirectQuery table that does the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LargestValue = 
VAR Result =
MAXX(
    FILTER(
        'Table',
        'Table'[Type] = EARLIER('Table'[Type])),
    'Table'[Value]
)
RETURN
IF(
    'Table'[Value] = Result,
    'Table'[Value],
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in my visual I just filter out blanks and everything works as I need it to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also realize that this is close to the original solution proposed, but with a few differences. Once, it's not a measure, but a new column. Two, it has less MAX's throughout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;for the inspiration though.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 19:14:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-all-kinds-in-one-column-pick-value-in-second-column-based-on/m-p/3661247#M141878</guid>
      <dc:creator>sslezic</dc:creator>
      <dc:date>2024-01-25T19:14:12Z</dc:date>
    </item>
  </channel>
</rss>

