Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Row wise grouping using DAX

Hi All, Have data set like above image and am struggling for grouping of data, row wise. using DAX or MDAX. Like in above image "short_lable" column having "Tremination point" and sequence ...
  • v-yanjiang-msft's avatar
    v-yanjiang-msft
    3 years ago

    Hi Anonymous ,

    Sorry for late back. Modify the formula to:

    Column =
    " Group "
        & RANKX (
            FILTER ( 'Table', 'Table'[pre code] = EARLIER ( 'Table'[pre code] ) ),
            MINX (
                FILTER (
                    'Table',
                    'Table'[Sequence No] >= EARLIER ( 'Table'[Sequence No] )
                        && 'Table'[Short_Label] = "Termination point"
                        && 'Table'[pre code] = EARLIER ( 'Table'[pre code] )
                ),
                'Table'[Sequence No]
            ),
            ,
            ASC,
            DENSE
        )
    

    Get the correct result.

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

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