Forum Discussion
Row wise grouping using DAX
- 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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description, here's my solution, create a calculated column.
Column =
" Group "
& RANKX (
'Table',
MINX (
FILTER (
'Table',
'Table'[Sequence No] >= EARLIER ( 'Table'[Sequence No] )
&& 'Table'[Short_Label] = "Termination point"
),
'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.
Hi v-yanjiang-msft ,
Thanks for suggestion ...
but now data has been updated have to consider "Pre Code" as well same scenario but if perception code change group should start like G1,G2,G3 again ..... because sequence no start with 100 with every new Pre code.
Thanks ,
PD
- v-yanjiang-msft3 years agoCommunity Support
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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.