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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jenil_Gala
Frequent Visitor

Unpivot Column

Hi,

 

I am trying to unpivot columns in transform/power query, but its disappearing some rows from that column. Can you help me why its removing these rows?

2 ACCEPTED SOLUTIONS
MarkLaf
Super User
Super User

Unpivot will drop nulls. If you want to keep the nulls, the only way I know of is to replace all nulls with some placeholder character/value (I'm partial to: ☃ ), unpivot, then switch back your placeholders to null.

 

If that isn't the issue, please provide some sample data that recreates your issue.

View solution in original post

v-pnaroju-msft
Community Support
Community Support

Thankyou, @MarkLaf, for your response.

Hi Jenil_Gala,

We sincerely appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding, the issue you are facing arises because blank cells in Excel are interpreted as null values in Power Query. When using the Unpivot Columns feature, rows containing null values in the unpivoted column are automatically removed by default.

Kindly follow the procedure outlined below to retain the rows with null values:

  1. In Power Query, select the columns you wish to unpivot. Use the Replace Values option to substitute null values with a placeholder (for example, “_NULL_”). Then unpivot the columns. Afterward, replace the placeholder “_NULL_” back to null.

Additionally, please refer to the following links for more information:
Replace values and errors - Power Query | Microsoft Learn
Unpivot columns - Power Query | Microsoft Learn

If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will assist other community members who may have similar queries. Should you have any further questions, please feel free to contact the Microsoft Fabric community.

Thank you.

View solution in original post

3 REPLIES 3
v-pnaroju-msft
Community Support
Community Support

Thankyou, @MarkLaf, for your response.

Hi Jenil_Gala,

We sincerely appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding, the issue you are facing arises because blank cells in Excel are interpreted as null values in Power Query. When using the Unpivot Columns feature, rows containing null values in the unpivoted column are automatically removed by default.

Kindly follow the procedure outlined below to retain the rows with null values:

  1. In Power Query, select the columns you wish to unpivot. Use the Replace Values option to substitute null values with a placeholder (for example, “_NULL_”). Then unpivot the columns. Afterward, replace the placeholder “_NULL_” back to null.

Additionally, please refer to the following links for more information:
Replace values and errors - Power Query | Microsoft Learn
Unpivot columns - Power Query | Microsoft Learn

If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will assist other community members who may have similar queries. Should you have any further questions, please feel free to contact the Microsoft Fabric community.

Thank you.

Jenil_Gala
Frequent Visitor

Hi,

 

Thanks for reply. I think it was the blanks in my excel data that was causing issues. You are right. 

MarkLaf
Super User
Super User

Unpivot will drop nulls. If you want to keep the nulls, the only way I know of is to replace all nulls with some placeholder character/value (I'm partial to: ☃ ), unpivot, then switch back your placeholders to null.

 

If that isn't the issue, please provide some sample data that recreates your issue.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Kudoed Authors