Forum Discussion

Asking's avatar
Asking
Regular Visitor
3 years ago
Solved

Counting Occurrences

Hi,   I have a table that is filtered on the dashboard based on ID: ID Value 1   X 1   Y 2    X 2   Z 3   X 3   Y if I used the function CONCATENATEX I can get a table like this 1 X,Y 2 X...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Asking  ,

     

    You can create a new column in table, the code is as follows:

     

    Column = CONCATENATEX(FILTER('Table (2)','Table (2)'[ID]=EARLIER('Table (2)'[ID])),'Table (2)'[Value],",")

     

     

     

     

     

    Then create a new table

    Table 2 = var a=SUMMARIZE('Table (2)','Table (2)'[ID],'Table (2)'[Column])
     var b=SUMMARIZE(a,[Column])
     return ADDCOLUMNS(b,"count",COUNTAX(FILTER(a,[Column]=EARLIER('Table (2)'[Column])),[Column]))

     

     

     

     

     

     

    Best Regards,

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.