Forum Discussion
Row count at each step in Query (Power BI Desktop)
- 9 years ago
An aternative workaround would be to create your query and next, in the Advanced Editor, add some row count steps after steps you want to verify.
My guess is that there would be a limited number of steps that could possibly influence the number of rows in your table, so you don't need to do it after each query step.
You can (de)comment the row count steps as required.
C0010 = Table.RowCount(PreviousStep),
You may also want to check again when you refresh your data: maybe rows won't be added with the current snapshot, but they might be with future data.
Just to add to this, you can turn on "Column profile" under "View" in the Query Editor. This gives a count of values in any particular column. (As long as you have "Column profiling based on entire dataset" turned on)
Bit quicker than adding a new custom column.
- SGriga5 years agoAdvocate I
This is a great advice! Just to add clarity:
"To change the profiling so it analyses the entire column of data, select the profiling status in the status bar. Then select Column profiling based on the entire data set." (source)
- BA_Pete3 years agoSuper User
For future readers, just to crank this up a notch, let's say you have a 100-step query with 40 merges (I know, right!), and you just want to see your row counts change over the entire thing without too much effort. Well then, give this a whizz:
-1- Duplicate your query
-2- Open Advanced Editor on your copy and change the 'let' to '[', and your 'in lastStep' to ']'. So:
let Source = mySource, someStuff = doTransformMagic in someStuff ...goes to: [ Source = mySource, someStuff = doTransformMagic ]This will convert your query into a record, with each step being its own row, something like this:
-3- Convert your record into a table and add a custom column that is just = Table.RowCount([Value])
Et Voila:
Then, to update later when new steps are added, you can just copy your current query between let and in, and paste it into your copy between [ and ].
Pete