March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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
Solved! Go to Solution.
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.
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
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
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
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.
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?
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
12 | |
10 | |
7 | |
6 | |
4 |