Forum Discussion
Concatenex with Rank
- 1 year ago
I solved by editing above measures.
First I created one column Sorting in Power query from date column and stage
Date.Year([Date])*100000000
+Date.Month([Date])*1000000
+Date.Day([Date])*10000
+Text.End([Stage],1)and measure edit:
Stage Measure = VAR CurrentYear = SELECTEDVALUE('DateTable'[Year]) -- Gets the selected year from the DateTable VAR Projects = DISTINCT('Stage table'[Project]) -- Get distinct projects for iteration RETURN CONCATENATEX( ADDCOLUMNS( FILTER( 'Stage table', YEAR('Stage table'[Date]) = CurrentYear ), "Rank_Stage", FORMAT( RANKX( FILTER( 'Stage table', 'Stage table'[Project] = EARLIER('Stage table'[Project]) && YEAR('Stage table'[Date]) = CurrentYear ), 'Stage table'[Sorting], , ASC ), "0" ) & " " & 'Stage table'[Stage] ), [Rank_Stage], ", ", 'Stage table'[Date], ASC )
Hi Jyaul1122 , I have achieved your expected output as below, have attached the PBIX file along with this post
Did I answer your question ? If yes, please mark this post as a solution.
Thanks,
Jai
- Jyaul11221 year agoHelper III
Thanks for your reply, we are very close to solution.
Could you please sort by rank, for example in Project 3, rank 1 will be appear first with stage, then second rank with stage and so on
- Jai-Rathinavel1 year agoSuper User
Jyaul1122 , It can be done by just introducing an orderby field (Table[Rank]) to the CONCATENATEX funtion. Replace the current measure expression with the below dax.
Concat = var res = CONCATENATEX('Table', 'Table'[Rank] & " " & 'Table'[Stage],",",'Table'[Rank]) RETURN resOutput:
If the DAX meets your expectation, please mark this post as a solution
Thanks,
Jai