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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
arkiboys2
Helper III
Helper III

dataflow - if there is a row present

hello,

in the dataflow gen2, there are several steps from navigation of the source all the way to pivot column.

After the pivot, the step is to rename column. But the flow fails on this rename step because if there is no data then the step fails as the column does not exists

 

Any suggestions ?

thank you

2 ACCEPTED SOLUTIONS

I would add a dummy row with the necessary columns before that step, so that the step doesn't fail, and then I would filter away the dummy row afterwards. 

View solution in original post

I created a HelperRow which only has columns and no rows.

Then after the pivot step, I appended this helper row.

It seems fine now

 

thank you

View solution in original post

9 REPLIES 9
v-jingzhan-msft
Community Support
Community Support

Hi @arkiboys2 

 

If you use Table.RenameColumns to rename columns, a simple solution is to add MissingField.Ignore at the end. MissingField.Type - PowerQuery M | Microsoft Learn

vjingzhanmsft_0-1730946216874.png

vjingzhanmsft_1-1730946616923.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

frithjof_v
Community Champion
Community Champion

If you want to do the try ... otherwise ... logic instead of adding a dummy row, there is a description in the link. I can actually recommend to go through all the parts of this series if you have the time:

 

https://bengribaudo.com/blog/2020/01/15/4883/power-query-m-primer-part-15-error-handling

 

I've done most of the parts, but I skipped the last ones as I didn't feel they were so relevant for my use cases at the time.

 

I don't think there are so many users who have gone through this series, but it gives a great theoretical description (and also many practical examples!) of the Power Query M language. If you have the time. I had already worked 3 years with Power BI/Power Query before I did this series.

lbendlin
Super User
Super User

use try ... otherwise ...  to decide what to produce in this scenario.

you mean to have try catch inside dataflow gen2? is this the only way?

how is this possible?

thanks

You could add a dummy row.

 

However, do you want the dataflow to succeed if there is no data?

yes to succeed if there is no row. thanks

I would add a dummy row with the necessary columns before that step, so that the step doesn't fail, and then I would filter away the dummy row afterwards. 

Thankyou

I created a HelperRow which only has columns and no rows.

Then after the pivot step, I appended this helper row.

It seems fine now

 

thank you

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.