Forum Discussion
mtrevisiol
4 years agoHelper V
How to duplicate rows based on two columns?
Hi everyone, I've got a table that represents the hours of work of some employees. It contains the name of the employee, the start date and time and the end date and time: My intent is to...
- 4 years ago
So before merging column create conditional column to check if DataStart <> DataEnd if true then merge : DataStart & "|" & DataEnd else null
And now split this conditional column !
freginier
4 years agoSolution Sage
In Power Query :
- Merge DataStart and DataEnd into one column with pipe ("|") delimiter for example
- Split this column on row (not column)
You should get what you want
mtrevisiol
4 years agoHelper V
freginier thank you so much, it works!
But I have another problem: if I wanted to "split" only the rows where DataStart is different from DataEnd?
The ideal result would be this:
Thanks.
- freginier4 years agoSolution Sage
So before merging column create conditional column to check if DataStart <> DataEnd if true then merge : DataStart & "|" & DataEnd else null
And now split this conditional column !
- mtrevisiol4 years agoHelper V
freginier thank you so much!