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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JK-1
Helper I
Helper I

Date string list - ascending order

Very novice here. Be gentle 🙂 Thanks

 

I have a number of dates that are already sorted in column being referenced but when concat in new string they aren't given in Ascending order.


Certs string = CONCATENATEX(FILTER((Site),Site[Site No]=EARLIER(Site[Site No])),Site[Effective Date],"; ")

 

it won't accept ,,ASC / ,ASC which I used before in RANKX but that time it wasn't using any extra condition

So the 2009 and 2011 I'd like at the start, are being presented at the end of the string. The string is fine from 2013 but just wondering on possibilities

JK1_0-1739112186961.png

2 ACCEPTED SOLUTIONS
hnguy71
Super User
Super User

Hi @JK-1 ,
You should be able to use the ORDER BY optional parameter in the concatenatex function. This should work:

CONCATENATEX(FILTER(Site, Site[Site No] = EARLIER(Site[Site No])), [Effective Date], ";", [Effective Date], ASC)

 
Notice the second "Effective Date" field. We're using it to tell the expression to sort by the effective date in ascending order.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

Hi @JK-1 

You seem to be missing a part of the evaluation. I've attached a sample for your reference.

 

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

6 REPLIES 6
hnguy71
Super User
Super User

Hi @JK-1 ,
You should be able to use the ORDER BY optional parameter in the concatenatex function. This should work:

CONCATENATEX(FILTER(Site, Site[Site No] = EARLIER(Site[Site No])), [Effective Date], ";", [Effective Date], ASC)

 
Notice the second "Effective Date" field. We're using it to tell the expression to sort by the effective date in ascending order.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Would there be a way to expand the expression so in the sorted date string it returns dates up to a certain point in time, either TODAY() - or using another column containing alternative end date(s)?

🤞

Hi @JK-1 

Yes, you would add it within your FILTER criteria:

hnguy71_0-1746278550279.png

 

CONCATENATEX(
    FILTER('Site', 
        'Site'[Site No] = EARLIER('Site'[Site No]) &&       // Using the double && or || to denote that there are additional conditions to be met
         [Effective Date] >= DATE(2025, 1, 1)               // && means 'and' while || means 'or'
                                                            // continue with your filter criteria until it meets your requirements. Sample.
    ), 
    [Effective Date], "; ", [Effective Date], ASC
)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thanks for this. It returns the dates as just TRUE, TRUE, FALSE

Etc.

rather than just the date format previously. Was hoping there might be a way to only display the trues but with their dates intact - and for the false ones to drop out.

 

sorry for the overly complicated ask

Hi @JK-1 

You seem to be missing a part of the evaluation. I've attached a sample for your reference.

 

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thank you for your help. Much appreciated 👍 for time and extra effort

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.