Forum Discussion
kivancc94
3 years agoHelper I
Sorting Months by Concatanatex function
Hi, I would be happy if you could help me. Trying to sort "Month Name" column by using Concatanatex function. But it s not sorting in a correct order. Best regards
- 3 years ago
hi kivancc94 ,
CONCATENATEX has an argument for sorting. First create a Month Sort measure - based on test, the measure has to be created outside CONCATENATEX otherwise the values will not be in the expected order.
Month Sort Measure = SELECTEDVALUE ( Dates[Month Number] )or
Month Sort Measure = MONTH ( Dates[Date] )Then update your formula similar to below
MONTHS = CONCATENATEX ( VALUES ( Dates[Month Name] ), Dates[Month Name], UNICHAR ( 10 ), [Month Sort Measure], ASC )
danextian
3 years agoSuper User
hi kivancc94 ,
CONCATENATEX has an argument for sorting. First create a Month Sort measure - based on test, the measure has to be created outside CONCATENATEX otherwise the values will not be in the expected order.
Month Sort Measure =
SELECTEDVALUE ( Dates[Month Number] )
or
Month Sort Measure =
MONTH ( Dates[Date] )
Then update your formula similar to below
MONTHS =
CONCATENATEX (
VALUES ( Dates[Month Name] ),
Dates[Month Name],
UNICHAR ( 10 ),
[Month Sort Measure], ASC
)