Forum Discussion
James13
2 years agoFrequent Visitor
Sequencing a calculated Table
Hi guys have a question if it is posible to sequence numbering base on the score column in this kind of calculated table in power bi I tried the RANKX formula but as you can see at the photo ...
- 2 years ago
James13 You need the Mythical DAX Index. The Mythical DAX Index - Microsoft Fabric Community
PBIX is attached below signature.
Table 2 = VAR __SourceTable = 'Table' VAR __Count = COUNTROWS( __SourceTable ) VAR __SortText = CONCATENATEX( __SourceTable, [ID], "|" ) VAR __Table = ADDCOLUMNS( GENERATESERIES( 1, __Count, 1 ), "__ID", PATHITEM( __SortText, [Value], TEXT ) ) VAR __Result = ADDCOLUMNS( __SourceTable, "seq", MAXX( FILTER( __Table, [__ID] = [ID] ), [Value] ) ) RETURN __Result - 2 years ago
James13 Yes, the 4th and 5th parameters of CONCATENATEX handle what to sort by and the sort direction.
Greg_Deckler
2 years agoCommunity Champion
James13 You need the Mythical DAX Index. The Mythical DAX Index - Microsoft Fabric Community
PBIX is attached below signature.
Table 2 =
VAR __SourceTable = 'Table'
VAR __Count = COUNTROWS( __SourceTable )
VAR __SortText = CONCATENATEX( __SourceTable, [ID], "|" )
VAR __Table =
ADDCOLUMNS(
GENERATESERIES( 1, __Count, 1 ),
"__ID", PATHITEM( __SortText, [Value], TEXT )
)
VAR __Result =
ADDCOLUMNS(
__SourceTable,
"seq", MAXX( FILTER( __Table, [__ID] = [ID] ), [Value] )
)
RETURN
__Result
- James132 years agoFrequent Visitor
is it posbile to sort it to score in desc order? because i want to put another column to identify the Q1 Q2 Q3 Q4
- Greg_Deckler2 years agoCommunity Champion
James13 Yes, the 4th and 5th parameters of CONCATENATEX handle what to sort by and the sort direction.
- James132 years agoFrequent Visitor
Thanks sir, much appreciated.