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! Learn more

Reply
Tome_05
Helper III
Helper III

Please tell me how to conditionally add a "row" in Power Query Editor.

I am always grateful for your help.

 

If anyone knows how to do it please let me know.
Currently, I have data like the attached image.
What I want to do is if the Value is 2, I would like to add one more data to the row with the same "ID", "Status", and "Value" data.
If Value is 4, add the remaining 3.
If Value is 8, add the remaining 7.
I would like to add a row with an upper limit like this, but if anyone knows how to do it, please let me know.

01.png

thank you.

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Tome_05 

here is a workaround for you

create a new column 

=Text.Repeat(",",[value]-1)

 

11.PNG

then split olumn to rows

12.PNG

13.PNG

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

v-weiyan1-msft
Community Support
Community Support

Hi @Tome_05 ,

 

@ryan_mayu nice method! Thank you, for your helpful and quick response.
And you can also consider the following method.
1.Use the following code to add custom column in the Power Query Editor.

Table.Repeat(#table({"ID", "Status", "value"}, {{[ID], [Status], [value]}}), [value])

vweiyan1msft_0-1708330265535.png

2.Expand the new custom column.

vweiyan1msft_1-1708330281057.png

3.Then you can remove other temporary columns that created during the process.

vweiyan1msft_2-1708330299142.png

Result is as below.

vweiyan1msft_4-1708330366567.png

Is this the result you expect?
Please correct me if I misunderstood your needs.


Best Regards,
Yulia Yan


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

View solution in original post

3 REPLIES 3
v-weiyan1-msft
Community Support
Community Support

Hi @Tome_05 ,

 

@ryan_mayu nice method! Thank you, for your helpful and quick response.
And you can also consider the following method.
1.Use the following code to add custom column in the Power Query Editor.

Table.Repeat(#table({"ID", "Status", "value"}, {{[ID], [Status], [value]}}), [value])

vweiyan1msft_0-1708330265535.png

2.Expand the new custom column.

vweiyan1msft_1-1708330281057.png

3.Then you can remove other temporary columns that created during the process.

vweiyan1msft_2-1708330299142.png

Result is as below.

vweiyan1msft_4-1708330366567.png

Is this the result you expect?
Please correct me if I misunderstood your needs.


Best Regards,
Yulia Yan


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

ryan_mayu
Super User
Super User

@Tome_05 

here is a workaround for you

create a new column 

=Text.Repeat(",",[value]-1)

 

11.PNG

then split olumn to rows

12.PNG

13.PNG

pls see the attachment below





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

Proud to be a Super User!




aj1973
Community Champion
Community Champion

Hi @Tome_05 

Power BI is a read only SaaS, you can't add rows to its semantic model.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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