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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Kudoed Authors