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



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 @jamie_yeo ,

 

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