<?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: want derived table with only distinct values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3216203#M117424</link>
    <description>&lt;P&gt;I haven't yet tried either of your specific suggestions, but they were enough to unblock me.&amp;nbsp; Thank you!&amp;nbsp; I decided to start from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Table = 
  SUMMARIZE(
    'Table',
    [ID],
    [Item Name],
    [Item Color]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect throwing away all the ownership information.&amp;nbsp; At least I have a correctly deduped table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I worry about your 1st suggestion -- how does MAX function w.r.t. strings?&amp;nbsp; And would it guarantee that the Owning Org + Owning Person were a valid pair?&amp;nbsp; Your 2nd suggestion looks like it would work perfectly and I may try that soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a follow-up question which I'm hoping you or someone else can answer.&amp;nbsp; I have my main page working fine, and users can filter in many different ways, and all changes they make reflect in all views -- great.&amp;nbsp; Now I wish my deduped item data set was also filtered to the selections made on report page 1, and would dynamically update as filter changes were applied on that page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 17:21:56 GMT</pubDate>
    <dc:creator>rhaining</dc:creator>
    <dc:date>2023-05-02T17:21:56Z</dc:date>
    <item>
      <title>want derived table with only distinct values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3214261#M117320</link>
      <description>&lt;P&gt;My source table has dupes, by design.&amp;nbsp; It's denormalized.&amp;nbsp; Imagine something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Item ID | Item Name | Item Color | Owning Org | Owning Person&lt;/P&gt;&lt;P&gt;=========================================&lt;/P&gt;&lt;P&gt;1 | Car | Green | Finance | Joe&lt;/P&gt;&lt;P&gt;1 | Car | Green | Finance | Sally&lt;/P&gt;&lt;P&gt;1 | Car | Green | HR | Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This data is exactly what I need for most of my views -- the same item must be reported under multiple owners -- but I want a 2nd view that has no duplicates.&amp;nbsp; All item attributes are identical across all rows (item #1 will always be a car and green), but some or all of the ownership attributes will vary across near duplicate rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect, I want to summarize by Item ID, but I never want to sum or count.&amp;nbsp; Instead, for item attributes, I want to take any or the first value -- they will be the same, so whatever is cheapest / fastest in terms of compute -- and for the ownership attributes, my ideal would be to take the "mode" or most common value, but I'd happily start with just any or the first value.&amp;nbsp; However, for all other ownership attributes, I want to take the matching values.&amp;nbsp; E.g. I can't have Owning Org be HR and Owning Person to be Joe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Almost none of the attributes / fields are scalars, and even for those that are, I still don't want sum or count.&amp;nbsp; I could probably use average here but that seems needlessly complex given the values will all be the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:27:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3214261#M117320</guid>
      <dc:creator>rhaining</dc:creator>
      <dc:date>2023-05-01T19:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: want derived table with only distinct values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3214297#M117323</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="552806" data-lia-user-login="rhaining" class="lia-mention lia-mention-user"&gt;rhaining&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Table = 
  SUMMARIZE(
    'Table',
    [ID],
    [Item Name],
    [Item Color],
    "Owning Org", MIN('Table'[Owning Org]),
    "Owning Person", MIN('Table'[Owning Person])
  )


or

New Table = 
  VAR __Table = 
  SUMMARIZE(
    'Table',
    [ID],
    [Item Name],
    [Item Color],
    [Owning Org],
    [Owning Person],
    "Count", COUNTROWS('Table')
  )
  VAR __Max = MAXX(__Table, [Count])
  VAR __Result = TOPN( 1, FILTER(__Table, [Count] = __Max))
RETURN
  __Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:38:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3214297#M117323</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-05-01T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: want derived table with only distinct values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3216203#M117424</link>
      <description>&lt;P&gt;I haven't yet tried either of your specific suggestions, but they were enough to unblock me.&amp;nbsp; Thank you!&amp;nbsp; I decided to start from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Table = 
  SUMMARIZE(
    'Table',
    [ID],
    [Item Name],
    [Item Color]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect throwing away all the ownership information.&amp;nbsp; At least I have a correctly deduped table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I worry about your 1st suggestion -- how does MAX function w.r.t. strings?&amp;nbsp; And would it guarantee that the Owning Org + Owning Person were a valid pair?&amp;nbsp; Your 2nd suggestion looks like it would work perfectly and I may try that soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a follow-up question which I'm hoping you or someone else can answer.&amp;nbsp; I have my main page working fine, and users can filter in many different ways, and all changes they make reflect in all views -- great.&amp;nbsp; Now I wish my deduped item data set was also filtered to the selections made on report page 1, and would dynamically update as filter changes were applied on that page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 17:21:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/want-derived-table-with-only-distinct-values/m-p/3216203#M117424</guid>
      <dc:creator>rhaining</dc:creator>
      <dc:date>2023-05-02T17:21:56Z</dc:date>
    </item>
  </channel>
</rss>

