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
Anonymous
Not applicable

Concatenate Dates based on ID

Hi,

 

Could someone help me with below requirement. I want to concatenate dates against ID as below

 

suren947_0-1626428252526.png

Thank in advance

Suren

2 ACCEPTED SOLUTIONS

Hi  @Anonymous ,

 

First go to query editor>create an index column;

Then create a column as below:

 

contatenated date = 
var _minindex=CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])))
Return
IF('Table'[Index]<>_minindex,CONCATENATEX(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[Index]<=EARLIER('Table'[Index])),'Table'[Date],","))

 

And you will see:

vkellymsft_0-1626687248897.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

Anonymous
Not applicable

Thank you Kelly for your time 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you Kelly for your time 

amitchandak
Super User
Super User

@Anonymous , Try a new column like

 

calculate(concatenatex(distinct(Table[Date]), [Date]), filter(Table, [ID] =earlier([ID])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you Amit for you suggestion.

Column = CALCULATE(CONCATENATEX(DISTINCT(Sheet2[Date]),Sheet2[Date]),FILTER(Sheet2,[ID]=EARLIER([ID])))

But the expression didn't help me to get desired output. I need to mimic column "Concatenated Date".

 

suren947_1-1626435547872.png

 

a. if "Date" appears for first time against ID,concatenation should not be done 

 b. if we have different "Date" against same ID then concatenated two dates (First & Second) and sould be shown in row of second occurence 

 

Thank you in advance

Suren

Hi  @Anonymous ,

 

First go to query editor>create an index column;

Then create a column as below:

 

contatenated date = 
var _minindex=CALCULATE(MIN('Table'[Index]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])))
Return
IF('Table'[Index]<>_minindex,CONCATENATEX(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[Index]<=EARLIER('Table'[Index])),'Table'[Date],","))

 

And you will see:

vkellymsft_0-1626687248897.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.