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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jacob1832
Frequent Visitor

Add a row based on conditions

My data set has a state column. I just want to add a row in my data set if the state column doesnt contain 'TX' in one of its rows. I dont care the method. 
If it was possible to add it straight to the visual with the conditions rather than the data, that would be cool too but i dont think its possible.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jacob1832 ,

 

Try to use the Table.InsertRows in the Power Query Editor.

In the advanced editor, like below.

vstephenmsft_0-1658301987152.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTI0MFCK1YlWSgKyjaDsZCDbGMSOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [state = _t, value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"state", type text}, {"value", Int64.Type}}),
    Custom1 = Table.InsertRows(#"Changed Type",2, { [state = "d", value = 400] })
in
    Custom1

 

Table.InsertRows - PowerQuery M | Microsoft Docs

How can I manually add a row to an existing table in Power Query? ~ Hey Niels!

 

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Jacob1832 ,

 

Try to use the Table.InsertRows in the Power Query Editor.

In the advanced editor, like below.

vstephenmsft_0-1658301987152.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTI0MFCK1YlWSgKyjaDsZCDbGMSOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [state = _t, value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"state", type text}, {"value", Int64.Type}}),
    Custom1 = Table.InsertRows(#"Changed Type",2, { [state = "d", value = 400] })
in
    Custom1

 

Table.InsertRows - PowerQuery M | Microsoft Docs

How can I manually add a row to an existing table in Power Query? ~ Hey Niels!

 

 

 

Best Regards,

Stephen Tao

 

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

lbendlin
Super User
Super User

Power BI cannot add rows.  You need to do that either in Power Query or in the upstream system.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.