Forum Discussion
Dataflow - How can I stop automatic steps being added
Someone may have pointed this out but, you should check column profiles for errors before you save your dataflows. And make sure you do with column profiling set to entire data set:
You can add a step at the end of your dataflow that will check for errors :
(In this example I voluntarily created a record with a text value in column "Score" to cause a type casting error)
let
Source = #table({"Name", "Score"}, {{"Betty", 90.3}, {"Carl", "a"}}),
#"Changed column type" = Table.TransformColumnTypes(Source, {{"Name", type text}, {"Score", type number}}),
#"Kept errors" = Table.SelectRowsWithErrors(#"Changed column type"),
#"final-step" = if Table.RowCount(#"Kept errors") > 0 then #table({"Error count"},{{#"Kept errors"}}) else #"Changed column type"
in
#"final-step"
You can add your transformation steps right after "Source" step and the "final-step" should tell you if you have errors or not. If it returns data with expected row count, you're good. If not, then click of the only cell showing up to see records that have errors. Click on #"Kept errors" step to see error messages and fix them in previous steps.
This way Power BI will most certainly add steps when saving your dataflow but your table will only have one column with only one record and a null value in it. Which makes it easy to spot somethign's wrong with your dataflow.
It would be better if we could just change a setting and ask Power BI Service to prevent saving if it detects errors instead of screwing with our data. That is another forum... Good luck with that one...