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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Michael_Tsai
Frequent Visitor

How to show all the year within a range in the new column

If i have 2 columns, the start of a range and the end of the range, how do i show all the year with in that range?

here [Years] is the example that i want to show:

Start_YearEnd_YearYears
201220172012,2013,2014,2015,2016,2017
202320242023,2024
200320062003,2004,2005,2006


Here are my current solution, using List.generate(). but it didn't work out after i use Text.Combine().

 

= Table.AddColumn(#"Table1", "Years", each 
    let EY = [End_Year]
    in
        List.Generate(() => [x=[Start_Year]],each [x] <= EY, each [ x = [x] +1], each [x]))

 

 

 

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Text.Combine(List.Transform({[Start_Year]..[End_Year]},Text.From),",")

Stéphane 

View solution in original post

3 REPLIES 3
slorin
Super User
Super User

Text.Combine(List.Transform({[Start_Year]..[End_Year]},Text.From),",")

Stéphane 

slorin
Super User
Super User

Hi

 

= Table.AddColumn(#"Table1", "Years", each {[Start_Year]..[End_Year]})

Stéphane 

how Do i convert the list with number to a string

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.