Forum Discussion
dataflow - if there is a row present
- 1 year ago
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.
- 1 year ago
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
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.