YOU SAID:
What are you thinking about doing that you did
INTO JAPANESE
何を考えてそんなことをしたのですか
BACK INTO ENGLISH
what were you thinking when you did that
INTO JAPANESE
あなたはそれをしたとき何を考えていましたか
BACK INTO ENGLISH
what were you thinking when you did that
You've done this before, haven't you.