Forum Discussion

rhaining's avatar
rhaining
Icon for Microsoft Employee rankMicrosoft Employee
3 years ago
Solved

want derived table with only distinct values

My source table has dupes, by design.  It's denormalized.  Imagine something like this:   Item ID | Item Name | Item Color | Owning Org | Owning Person ========================================= 1...
  • Greg_Deckler's avatar
    3 years ago

    rhaining Maybe:

     

    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