Forum Discussion

loganwol's avatar
loganwol
Microsoft Employee
9 years ago
Solved

Getting distinct values for multiple columns

Hi, I am summarizing data from one table into another. Part of the data in the original table is a column of type text which I generate a comma delimited summary string.   Issues = var ft ...
  • v-sihou-msft's avatar
    9 years ago

    loganwol

     

    In this scenario, since you have duplicate Issues for same ID, you should create a "summarized" data table for filtering the context. You can create a calcuated table like below:

     

    Data2 = SUMMARIZECOLUMNS(Data[ID],Data[Issue],Data[Result])
    

    Then you can involve the calcuated table in your formula.

     

    Issues =  
        var ft = FILTER(RELATEDTABLE(Data2), 
                      [ID] = Data2[ID] && Data2[Result] <> "Pass" && 
                      Not ISBLANK(TRIM(Data2[Issue]))) 
        var issuessummary = CONCATENATEX(ft, Data2[Issue], ",")
    return 
         issuessummary

    Regards,

     

    Simon Hou