Forum Discussion

pbin9_9's avatar
pbin9_9
Regular Visitor
3 years ago
Solved

PBI Column Based Unstructured Data Grouping

Hi All, I have a dataset as below, Data Group1 Jeremiah Lee Joshua Doyle Group2 Julie Miller Beth Stein Group3 Sierra Carroll Zachary Williams Group1 Paul Wi...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi pbin9_9 ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2)Click "Transform Data" to go to the Power Query editor, add index columns, click Apply and close.

    (3) We can create a table.

    Table 2 = var a=ADDCOLUMNS('Table',"groups",LOOKUPVALUE('Table'[Data],'Table'[Index],MAXX(FILTER('Table',[Index]<EARLIER('Table'[Index])&&CONTAINSSTRING([Data],"Group")),[Index])))
    var b=ADDCOLUMNS(a,"Combine",IF(CONTAINSSTRING([Data],"Group"),BLANK(),[groups]&":"&[Data]))
    return SUMMARIZE(FILTER(b,[Combine]<>BLANK()),[Combine])

     (4) Then the result is as follows.

    Best Regards,

    Neeko Tang

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