Forum Discussion

CarlBlunck's avatar
CarlBlunck
Resolver I
2 years ago
Solved

Choose column - weird behaviour

I'm experiencing some weird behaviour in a dataflow.  Here is the code:

 

let
  Source = VP_Schedule,
  #"Filtered rows" = Table.SelectRows(Source, each [#"Paycode-level1"] = "Leave"),
  #"Choose columns" = Table.SelectColumns(#"Filtered rows", {"PERSONFULLNAME","P1StartDate", "Leave taken"}),
  #"Renamed columns" = Table.RenameColumns(#"Choose columns", {{"PERSONFULLNAME", "PERSONNUM"}}),
  #"Grouped rows" = Table.Group(#"Renamed columns", {"PERSONNUM", "P1StartDate"}, {{"PlannedLeaveInPeriod", each List.Sum([Leave taken]), type nullable number}})
in
  #"Grouped rows"
 
The weird behaviour is that when I perform the choose columns step, the PERSONFULLNAME is returning the values from the PERSONNUM column and vice versa.  It happened when I created this flow and I thought it was just a weird cache thing or something. So I deleted the flow and built it again, but its still doing it.
 
Anyone seen anything like this before?  Or know how I can get this investigated properly?
 
Thanks
Carl
  • Ignore this...  I was just having a moment and didn't realise I had an error in an sql query...

2 Replies

  • #"Renamed columns" = Table.RenameColumns(#"Choose columns", {{"PERSONFULLNAME", "PERSONNUM"}}),

     

    Are you saying you now have two PERSONNUM columns in that table? Usually Power Query does not allow you to do that.

  • Ignore this...  I was just having a moment and didn't realise I had an error in an sql query...