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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic Lines

Hi guys, i need your help.

I have a table and i need to generate 5 new rows depended on a specific key. As an exaple please find the below table.

 

Object Field Value
AACTVT01
AACTVT02
AACTVT03
AACTVT08
AACTVT09
ADIS02
BACTVT01
BACTVT02
BACTVT*
BACTVT04
CDIS03
CACTVT08
CACTVT09
CACTVT*
CACTVT77

 

For each object + field when the value=* i want to generate 5 new lines, with the same object and field with specific values for each line (01, 02, 03, 04, 05). So the solution could be the table below 

 

Object Field Value

AACTVT01
AACTVT02
AACTVT03
AACTVT08
AACTVT09
ADIS02
BACTVT01
BACTVT02
BACTVT*
BACTVT01
BACTVT02
BACTVT03
BACTVT04
BACTVT05
CDIS03
CACTVT08
CACTVT09
CACTVT*
CACTVT01
CACTVT02
CACTVT03
CACTVT04
CACTVT05
CACTVT77

 

(New lines with red).

Could you please help me.

Thanks in advance

1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi, 

To obtain this (similar to your but without rows with *; if you need also rows with * it changes a little):

serpiva64_2-1644966380468.png

 

you can:

- create a table like this by entering data:

serpiva64_1-1644966218240.png

- merge this new table with the previous (join kind full outer):

serpiva64_3-1644966555273.png

- expand data

serpiva64_4-1644966632931.png

- replace * with null

- and finally merge the two columns

serpiva64_5-1644966722618.png

 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

and accepting it as a solution !

 

 

 

View solution in original post

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create a new calculation table as follows:

Table 2 = 
var _targetTable=FILTER(ALL('Table'),[ValueOfTable]="*")
var _generate5=GENERATESERIES(1,5,1)
var _newTable=GENERATE(_targetTable,_generate5)
var _selectColumns=SELECTCOLUMNS(_newTable,"Object",[Object]," Field",[ Field],"ValueOfTable",FORMAT([Value],"0#"))
var _Union=UNION(_selectColumns,'Table')

return _Union

Result:

vangzhengmsft_0-1645159908553.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

serpiva64
Solution Sage
Solution Sage

Hi, 

To obtain this (similar to your but without rows with *; if you need also rows with * it changes a little):

serpiva64_2-1644966380468.png

 

you can:

- create a table like this by entering data:

serpiva64_1-1644966218240.png

- merge this new table with the previous (join kind full outer):

serpiva64_3-1644966555273.png

- expand data

serpiva64_4-1644966632931.png

- replace * with null

- and finally merge the two columns

serpiva64_5-1644966722618.png

 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

and accepting it as a solution !

 

 

 

jennratten
Super User
Super User

Hello - this can be done with Power Query but I am wondering how this would be used.  Depending on the use case there may be better ways to solve the challenge.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors