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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Zyg_D
Continued Contributor
Continued Contributor

Return a dynamic list of values

This is the data:

col1col2
20122013
20122014
20172020

I cannot think of a way to get the 3rd column which would represent the full duration in text (from the value in the 1st column to the value in the 2nd column). Any guidance is well appreciated. 

col1col2col3
201220132012,2013
201220142012,2013,2014
201720202017,2018,2019,2020
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Zyg_D , Try a new column like

concatenatex( GENERATESERIES([year1] ,[year2],1), [Value])

 

In case it gives an error for value

Create a new table using this GENERATESERIES(1 ,10,1) and check column name and use that

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Zyg_D , Try a new column like

concatenatex( GENERATESERIES([year1] ,[year2],1), [Value])

 

In case it gives an error for value

Create a new table using this GENERATESERIES(1 ,10,1) and check column name and use that

Zyg_D
Continued Contributor
Continued Contributor


@amitchandak wrote:

@Zyg_D, Try a new column like

concatenatex( GENERATESERIES([year1] ,[year2],1), [Value])


This worked well:

 

newcol = CONCATENATEX( GENERATESERIES( table[col1], table[col2], 1), [Value], ",")

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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