Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ForgotID
Advocate I
Advocate I

How to order the months while using CONCATENETX

Hello All,

 

I am trying to show multiple selected value in a card by using the following DAX.

FSC_Periods = CALCULATE( CONCATENATEX(DISTINCT(Metrics[FSC_PERIOD_NAME]),Metrics[FSC_PERIOD_NAME],", ",Metrics[FSC_PERIOD_NAME]))
 
It works fine but the order of the output is either ascending or descending not in the calendar order.
For example if I selected JUL, AUG, SEP then it returns AUG, JUL, SEP whereas I want to show as JUL, AUG, SEP.
 
Is it even possible? Thanks
1 ACCEPTED SOLUTION

It worked. Thank you. Accepting it as solution!

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

hI @ForgotID 

 

CONCATENATEX has an optional order by parameter. Ensure that your table has such a column.

FSC_Periods =
CALCULATE (
    CONCATENATEX (
        DISTINCT ( Metrics[FSC_PERIOD_NAME] ),
        Metrics[FSC_PERIOD_NAME],
        ", ",
        CALCULATE ( SELECTEDVALUE ( Metrics[FSC_PERIOD_NAME_SORT] ) ) -- custom sort-by column in your table
    )
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

It worked. Thank you. Accepting it as solution!

bchager
Super User
Super User

@ForgotID  It sounds like you need to sort your FSC_PERIOD_NAME by the Date column within your table, which should also be sorted.

Thank you for your input

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors