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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Sankzpower
Helper I
Helper I

Generate number series based on total number of rows in another table

Hi guys

 

This probably a simple question but hope you can shed some light. I have a table from web api call which has over 80,000 rows plus keeps on increasing week by week. Now, I need to an another table with the same number of rows. Currently, I use the below to create series and manually increase each week or increase one off to 90,000.

 

 = GENERATESERIES(1,80000)
 
But does anyone has a better logic in increase this default?
 
Thanks in advance
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Sankzpower ,

 

Just add the following code refering to the first table:

 


Table 2 = GENERATESERIES(1, COUNTROWS('Table'))

 

Should work as expected.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Sankzpower ,

 

Just add the following code refering to the first table:

 


Table 2 = GENERATESERIES(1, COUNTROWS('Table'))

 

Should work as expected.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi I'm using version 2.105.664.0 but this makes an error which says "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value".
My DAX is this.
Measured Table = SELECTCOLUMNS(FILTER('MyTable', 'MyTable'[MyColumn] <> BLANK()),
"Column1", [Column1],
"Column2", [Column2],
"Column3", GENERATESERIES(1, COUNTROWS(FILTER('MyTable', 'MyTable'[MyColumn] <> BLANK()))))
 

Hi @Anonymous ,

 

Be aware that the calculation it was given was for a table, you are using a metric and metrics only return a single value so in this case you are trying to return a table, that is why it's giving you the scalar value error.

 

What is the result you want to achieve in this?is it a table?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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