Forum Discussion

jos818's avatar
jos818
Icon for Helper I rankHelper I
1 year ago
Solved

Aggregate string into groupings based on filter selection

Hi, I've perused some of the FAQs but can't seem to find a topic on the issue below. I have a data table with a multi variate field saved under a text column (Diagnosis). The front end is a multi s...
  • danextian's avatar
    1 year ago

    Hi jos818 

    In the query editor, I would add an index column which will serve as a reference to the original rows prior to adding a column that splits diagnosis into several rows for each semicolon

    The steps above will result to the table below.

    Notice that index 11  repeats 3x so the measure to total the views should take this into consideration.

    Total Views = 
    SUMX ( VALUES ( 'Table'[Index] ), CALCULATE ( MAX ( 'Table'[Daily views] ) ) )
    

     

    Please see the attached pbix.