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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Newcolator
Helper II
Helper II

Create a list of numbers using a variable

Hello

 

I need to create a table that contains the numbers 0 to n based on the number of months I have in my tables

I can use

= List.Numbers(0, 20) 

to create my list

 

,but I want the number of rows to be dependent on a minimum and maximum dates in another table. So, for example. If the minumum date in a column is 1/1/2022, and the maximum date in a different column is 1/7/2022, that's 7 months so I want 7 rows showing the numbers 0 to 6.

 

Is there a way to do this? I've tried using parameters to get the min and max date, but that doesn't seem to work.

 

Many thanks.

1 ACCEPTED SOLUTION
Newcolator
Helper II
Helper II

I think I have worked it out using = List.Numbers(0,List.Max(claims[ClosedDevMo])+1)

View solution in original post

2 REPLIES 2
Newcolator
Helper II
Helper II

I think I have worked it out using = List.Numbers(0,List.Max(claims[ClosedDevMo])+1)

Newcolator
Helper II
Helper II

Actually, change that slightly, forget about dates. I have a column in my containing the month number, I just need to create a table that goes from 0 to the max of that column value.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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