Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Summarizing/grouping together columns

Hi all, have a table of customers, some of which have multiple Customer IDs (like Microsoft in the sample table), but I really would like to classify this as one customer. I'd like to group customers...
  • Greg_Deckler's avatar
    6 years ago

    If I understand correctly, perhaps:

     

     

    Column =
      CONCATENATEX(
        FILTER('Table',[Customer Name] = EARLIER([Customer Name]) && [Region] = EARLIER([Region]))
        [Customer ID],", "
      )

     

  • camargos88's avatar
    6 years ago

    Hi Anonymous ,

     

    Try this one:

    Column =
    VAR _customer = CALCULATETABLE(DISTINCT('Table'[Customer ID]), FILTER('Table', 'Table'[Region] = EARLIER('Table'[Region]) && 'Table'[Customer Name] = EARLIER('Table'[Customer Name])))
    RETURN CONCATENATEX(_customer, 'Table'[Customer ID], ",")
     
  • ChrisMendoza's avatar
    6 years ago

    Anonymous -

    Measure solution attempt:

    Measure Modified Customer ID = 
    IF (
        ISFILTERED ( 'TableName'[Customer Name] ),
        CALCULATE (
            CONCATENATEX (
                DISTINCT ( TableName[Customer ID] ),
                TableName[Customer ID],
                ", "
            ),
            ALLEXCEPT ( 'TableName', 'TableName'[Customer Name], 'TableName'[Region] )
        ),
        BLANK ()
    )