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
Dubbie999
New Member

Adding Column Removes Rows

Hi,

 

I have a problem that I have never encountered before.  When a add a column, power query removes the previous years row.  The column formula is "If [LoadType] = "FTL" then [PlanShipDate] else [SchedShipDate]"  Can someone tell me why this happens and how to stop if from happening.

 

Thanks

1 ACCEPTED SOLUTION
Dubbie999
New Member

Thanks to all that responded.  I found the problem.  Someone changed the data table in the SQL database and the data was moved.

 

Thanks again

View solution in original post

3 REPLIES 3
Dubbie999
New Member

Thanks to all that responded.  I found the problem.  Someone changed the data table in the SQL database and the data was moved.

 

Thanks again

VN999
Resolver I
Resolver I

Please check this below options :

 

Check the Custom Column Formula:

  • Verify that your custom column formula is correct. The formula you mentioned should look like this in Power Query M language:      CustomColumn = if [LoadType] = "FTL" then [PlanShipDate] else [SchedShipDate]
  • Ensure No Unintended Filtering:Make sure there are no implicit filters applied in previous steps or within the formula itself. Sometimes, a filter applied in an earlier step can cause rows to be removed when adding a new column.
  • Verify Data Types:

    • Check the data types of LoadType, PlanShipDate, and SchedShipDate columns. Incorrect data types can cause unexpected behavior. Ensure LoadType is a text type and PlanShipDate and SchedShipDate are date types.
Legend_11
Resolver I
Resolver I

Could you please provide the sample data and also could you review the power query steps, 

 

Please use the below formula maybe it is because of Nulls present in any of the columns,

if [LoadType] = "FTL" and [PlanShipDate] <> null then [PlanShipDate]
else if [SchedShipDate] <> null then [SchedShipDate]
else null

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