I have a table like the following.

And i want to convert it to something like this

I tried to find the solution online but i didn't found anything related to my issues. Is there a excel or powerquery solution for this?
I have a table like the following.

And i want to convert it to something like this

I tried to find the solution online but i didn't found anything related to my issues. Is there a excel or powerquery solution for this?